Chapter 10 · Class 12 · CBSE · Science Computer Science
Structured Query Language (SQL)
25 practice questions · 5 marks weightage
Topics in this chapter
- DDL and Table Management
- DML Data Modification and Deletion
- Basic SELECT Queries and Filtering
- Aggregate Functions and NULL Handling
- Grouping and Summary Filters
- Joins and Multi-Table Operations
- Advanced Queries and Sorting
Cheat sheet
Cheat SheetPractice questions
- Question 1Q-A66CEESee the answer and solution
Which SQL query displays each different city name only once from the relation STUDENT?
- A.SELECT DISTINCT City FROM STUDENT;
- B.SELECT UNIQUE City FROM STUDENT;
- C.SELECT City FROM STUDENT GROUP City;
- D.SELECT DIFFERENT City FROM STUDENT;
- Question 2Q-D2A83ESee the answer and solution
A relation named EMPLOYEE has the columns EmpID, Dept, and Salary. Which query displays the departments whose average salary is greater than 50000?
- A.SELECT Dept FROM EMPLOYEE WHERE AVG(Salary) > 50000 GROUP BY Dept;
- B.SELECT Dept FROM EMPLOYEE GROUP BY Dept HAVING AVG(Salary) > 50000;
- C.SELECT Dept FROM EMPLOYEE HAVING AVG(Salary) > 50000;
- D.SELECT Dept, AVG(Salary) FROM EMPLOYEE WHERE Salary > 50000;
- Question 3Q-61ECF0See the answer and solution
A relation named STUDENT has the columns RollNo, Name, and Marks. Write an SQL query to display the Name and Marks of students whose Marks are between 60 and 80 inclusive, arranging the result in descending order of Marks.
- Question 4Q-F2FF44See the answer and solution
Which SQL query correctly adds a column named Email to the STUDENT table?
- A.ALTER TABLE STUDENT ADD COLUMN Email VARCHAR(50);
- B.UPDATE STUDENT ADD Email VARCHAR(50);
- C.INSERT COLUMN Email VARCHAR(50) INTO STUDENT;
- D.MODIFY STUDENT ADD Email VARCHAR(50);
- Question 5Q-7E53BDSee the answer and solution
A database has CUSTOMER(CustID, Name) and ORDERINFO(OrderID, CustID, Amount). Which query displays the names of customers who have not placed any order?
- A.SELECT c.Name FROM CUSTOMER c LEFT JOIN ORDERINFO o ON c.CustID = o.CustID WHERE o.OrderID IS NULL;
- B.SELECT c.Name FROM CUSTOMER c INNER JOIN ORDERINFO o ON c.CustID = o.CustID WHERE o.OrderID IS NULL;
- C.SELECT c.Name FROM CUSTOMER c RIGHT JOIN ORDERINFO o ON c.CustID = o.CustID WHERE c.CustID IS NULL;
- D.SELECT c.Name FROM CUSTOMER c LEFT JOIN ORDERINFO o ON c.CustID = o.CustID WHERE o.OrderID IS NOT NULL;
20 more questions on Structured Query Language (SQL)
Sign up free to practise the full chapter. Questions you get wrong come back until you've mastered them.
Start practising freeFree to start · No credit card needed