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 Sheet

Practice questions

  1. Question 1Q-A66CEE

    Which SQL query displays each different city name only once from the relation STUDENT?

    1. A.SELECT DISTINCT City FROM STUDENT;
    2. B.SELECT UNIQUE City FROM STUDENT;
    3. C.SELECT City FROM STUDENT GROUP City;
    4. D.SELECT DIFFERENT City FROM STUDENT;
    See the answer and solution
  2. Question 2Q-D2A83E

    A relation named EMPLOYEE has the columns EmpID, Dept, and Salary. Which query displays the departments whose average salary is greater than 50000?

    1. A.SELECT Dept FROM EMPLOYEE WHERE AVG(Salary) > 50000 GROUP BY Dept;
    2. B.SELECT Dept FROM EMPLOYEE GROUP BY Dept HAVING AVG(Salary) > 50000;
    3. C.SELECT Dept FROM EMPLOYEE HAVING AVG(Salary) > 50000;
    4. D.SELECT Dept, AVG(Salary) FROM EMPLOYEE WHERE Salary > 50000;
    See the answer and solution
  3. Question 3Q-61ECF0

    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.

    See the answer and solution
  4. Question 4Q-F2FF44

    Which SQL query correctly adds a column named Email to the STUDENT table?

    1. A.ALTER TABLE STUDENT ADD COLUMN Email VARCHAR(50);
    2. B.UPDATE STUDENT ADD Email VARCHAR(50);
    3. C.INSERT COLUMN Email VARCHAR(50) INTO STUDENT;
    4. D.MODIFY STUDENT ADD Email VARCHAR(50);
    See the answer and solution
  5. Question 5Q-7E53BD

    A database has CUSTOMER(CustID, Name) and ORDERINFO(OrderID, CustID, Amount). Which query displays the names of customers who have not placed any order?

    1. A.SELECT c.Name FROM CUSTOMER c LEFT JOIN ORDERINFO o ON c.CustID = o.CustID WHERE o.OrderID IS NULL;
    2. B.SELECT c.Name FROM CUSTOMER c INNER JOIN ORDERINFO o ON c.CustID = o.CustID WHERE o.OrderID IS NULL;
    3. C.SELECT c.Name FROM CUSTOMER c RIGHT JOIN ORDERINFO o ON c.CustID = o.CustID WHERE c.CustID IS NULL;
    4. D.SELECT c.Name FROM CUSTOMER c LEFT JOIN ORDERINFO o ON c.CustID = o.CustID WHERE o.OrderID IS NOT NULL;
    See the answer and solution

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 free

Free to start · No credit card needed