SQL CLASS 12TH CBSE PRACTICALS !

CLICK HERE TO GET FULL SOLUTIONS WITH OUTPUTS : HERE

Tables used :-




PRACTICALS AVAILABLE :-

1. Create the table Employee and Department.
Insert data in a table
2. Insert data in the table Employee and Department.
Simple Select
3. Display the details of all the employees.
4. Display the Salary, Zone, and Grade of all the employees.
5. Display the records of all the employees along with their annual salaries. The Salary
column of the table contains monthly salaries of the employees. The new column
should be given the name “Annual Salary”.
Conditional Select using Where Clause
6. Display the details of all the employees who are below 30 years of age.
7. Display the names of all the employees working in North zone.
8. Display the salaries of all the employees of department 10.
Using NULL
9. Display the details of all the employees whose Grade is NULL.
10. Display the details of all the employees whose Grade is not 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.
15. Display the names and salaries of all the employees who are not working in
department 20.
16. Display the names and salaries of all the employees who are working neither in West
zone nor in Centre zone.
17. Display the details of all the employees whose salary is between 32000 and 38000.
18. Display the details of all the employees aged above 30 in West zone.
Using IN Operator
#5/5
19. Display the names of all the employees who are working in department 20 or 30.
(Using IN operator)
Using BETWEEN Operator
20. Display the details of all the employees whose grade is between ‘A’ and ‘C’.
(Using BETWEEN operator)
Using LIKE Operator
21. Display the name, salary, and age of all the employees whose names start with ‘M’.
22. Display the name, salary, and age of all the employees whose names contain ‘a’
23. Display the details of all the employees whose names contain ‘a’ as the second
character.
Using Aggregate functions
24. Display the sum and average of the salaries of all the employees.
25. Display the highest and the lowest salaries being paid in department 10.
26. Display the number of employees working in department 10.
Using ORDER BY clause
27. Display the details of all the employees in the ascending order of their salaries.
28. Display the details of all the employees in the descending order of their names.
29. Display the details of all the employees in the ascending order of their grades and
within grades in the descending order of their salaries.
Using GROUP BY clause
30. Display the average age of employees in each department only for those departments
in which average age is more than 30.
Using UPDATE, DELETE, ALTER TABLE
31. Put the grade B for all those whose grade is NULL.
32. Increase the salary of all the employees above 30 years of age by 10%.
33. Delete the records of all the employees whose grade is C and salary is below 30000.
34. Add another column HireDate of type Date in the Employee table.
JOIN of two tables
35. Display the Name and Department Name of all the employees.
36. Display the name of the department and the name of the corresponding HOD for all
the departments.

Comments

Popular posts from this blog

My Coursera Financial Aid Application!

Class 10 Julius Caesar Notes |