Practical File class-XII
Practical File class-XII
Practical File class-XII
#1/3
Index for SQL
Name: _____________________________ Roll No.: ____
Consider the tables given below and answer the questions that follow:
Table: Employee
No Name Salary Zone Age Grade Dept
1 Mukul 30000 West 28 A 10
2 Kritika 35000 Centre 30 A 10
3 Naveen 32000 West 40 20
4 Uday 38000 North 38 C 30
5 Nupur 32000 East 26 20
6 Moksh 37000 South 28 B 10
7 Shelly 36000 North 26 A 30
Table: Department
Dept DName MinSal MaxSal HOD
10 Sales 25000 32000 1
20 Finance 30000 50000 5
30 Admin 25000 40000 7
Create Table
1. Create the table Employee.
2. Create the table Department.
Insert data in a table
3. Insert data in the table Employee
4. Insert data in the table Department.
Simple Select
5. Display the details of all the employees.
6. Display the Salary, Zone, and Grade of all the employees.
Conditional Select using Where Clause
7. Display the details of all the employees who are below 30 years of age.
8. Display the names of all the employees working in North zone.
9. Display the salaries of all the employees of department 10.
Using NULL
10. Display the details of all the employees whose Grade is NULL.
Using DISTINCT Clause
11. Display the names of various zones from the table Employee. A zone name should appear only once.
12. Display the various department numbers from the table Employee. A department number should be displayed
only once.
Using Logical Operators (NOT, AND, OR)
13. Display the details of all the employees of department 10 who are above 30 years of age.
14. Display the details of all the employees who are getting a salary of more than 35000 in the department 30.
#2/3
15. Display the names and salaries of all the employees who are working neither in West zone nor in Centre zone.
16. Display the names of all the employees who are working in department 20 or 30.
17. Display the details of all the employees whose salary is between 32000 and 38000.
Using BETWEEN Operator
18. Display the details of all the employees whose salary is between 32000 and 38000.
(Using BETWEEN operator)
19. Display the details of all the employees whose grade is between ‘A’ and ‘C’.
(Using BETWEEN operator)
#3/3