Class 12 CBSE MySQL Computer Science Worksheet
Class 12 CBSE MySQL Computer Science Worksheet
Class 12 CBSE MySQL Computer Science Worksheet
SQL queries:
Simple Select
5. Display the employee number, name and salary of all the employees
6. Display the details of all the employees salary less than 300000.
7. Display the employee number and salary of all the employees who joined
after 01- 04- 2009.
8. Display the employee number employee name of all the employees joined
before 01- 04- 2009
Using NULL
9. Display the details of all the employees whose bonus is NULL.
10. Display the details of all the employees whose bonus is not NULL.
Using DISTINCT class
11. Display the salary of employees from the table removing duplicate values.
12. Display the area code of employees from the table employees. An area code
should only once.
Using logical operators( NOT, AND,OR)
13. Display the details of all the employees joined after 31-12-2008 for which
the area code is more than 36.
14. Display the name and salary all the employees who don't have the area code
36.
15. Display the name and salary for all the employees for which the salary is
less than 500000 or bonus is more than 12.
16. Display the details of all the employees who joined in the year 2009.
17. display the details of all the employees whose bonus is in the range 11% to
12%.
18. display the details of all employees whose salary is in the range 400000 to
500000.
Using IN operator
19. display the name salary of all the employees for whom the bonus is 24, 36
or 48.
Using between operator
20. display the details of all the employees whose salary is in the range 400000
to 500000.
21. display the details of all the employees bonus is in the range 11% to 12%.
Using like operator
22. display the employee number name and salary for all the employees home
the name ends with 'Sharma'.
23. display the employee number name and salary of all the employees for
whom the name ends with 'a'.
24. display the employee number and salary for all the employees for whom the
name contains 'a'.
25.display the employee number salary of all employees for whom the name
does not contain 'p'.
26. display the employee number name and salary of all the employees for
whom the name contains a as the second last character 'P'.
Using order by clause
27.display the details of all the employees in the ascending order of their salary.
28. display the details of all the employees in the descending order of their join
date.
29. display the details of all employees in the ascending order of their salary and
within the salary in descending order of the joining date.
Using update,delete,alter table
30. assigned the bonus 15.50% for all the employees for which the bonus is
null.
31. increase the bonus by 0.5% for all the employees for which salary is more
than 400000.
32. for every employees bonus with (salary* bonus)/12*100.
33. delete the records of employee N.P.jain
34. add another column category of type char(5 )in the employee's table