0% found this document useful (0 votes)
32 views3 pages

SQL Output Based Worksheet Class12

The document contains SQL practice questions for Class 12 CBSE students, divided into three sets based on different tables: EMPLOYEE, SALES, and STUDENT. Each set includes various SQL queries that focus on data selection, aggregation, and filtering. The exercises aim to enhance students' understanding of SQL operations and database management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views3 pages

SQL Output Based Worksheet Class12

The document contains SQL practice questions for Class 12 CBSE students, divided into three sets based on different tables: EMPLOYEE, SALES, and STUDENT. Each set includes various SQL queries that focus on data selection, aggregation, and filtering. The exercises aim to enhance students' understanding of SQL operations and database management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

SQL Practice Worksheet – Output-Based

Questions
Class 12 – CBSE (083)

Set 1: Table – EMPLOYEE


EmpID Name Dept Salary

101 Ravi Sales 50000

102 Meena HR 62000

103 Karan IT 55000

104 Sneha Sales 48000

105 Varun IT 60000

Answer the following:

1. Q1. SELECT Name, Salary FROM EMPLOYEE WHERE Dept = 'Sales';


2. Q2. SELECT * FROM EMPLOYEE WHERE Salary BETWEEN 50000 AND 60000;
3. Q3. SELECT Dept, COUNT(*) FROM EMPLOYEE GROUP BY Dept;
4. Q4. SELECT * FROM EMPLOYEE WHERE Name LIKE 'S%';
5. Q5. SELECT Name FROM EMPLOYEE WHERE Dept = 'IT' AND Salary > 57000;
Set 2: Table – SALES
SaleID Product Qty Amount

201 Pen 10 100

202 Pencil 20 80

203 Notebook 15 300

204 Pen 25 250

205 Notebook 10 200

Answer the following:

6. Q1. SELECT Product, SUM(Amount) FROM SALES GROUP BY Product;


7. Q2. SELECT Product, SUM(Amount) FROM SALES GROUP BY Product HAVING
SUM(Amount) > 200;
8. Q3. SELECT * FROM SALES WHERE Amount / Qty > 10;
9. Q4. SELECT COUNT(DISTINCT Product) FROM SALES;
10. Q5. SELECT Product FROM SALES WHERE Qty BETWEEN 10 AND 20;
Set 3: Table – STUDENT
RollNo Name Class Marks

301 Anu XII 85

302 Rohan XII 92

303 Divya XII 78

304 Nikhil XII 88

305 Sara XII 65

Answer the following:

11. Q1. SELECT AVG(Marks) FROM STUDENT;


12. Q2. SELECT Name FROM STUDENT WHERE Marks < (SELECT AVG(Marks) FROM
STUDENT);
13. Q3. SELECT MAX(Marks) FROM STUDENT;
14. Q4. SELECT Name FROM STUDENT WHERE Marks BETWEEN 80 AND 90;
15. Q5. SELECT COUNT(*) FROM STUDENT WHERE Marks >= 75;

You might also like