Friday, September 18, 2015

SQL Basic Practice Questions.



Sql question for beginner practice.

1. Display all the employees from emp table
2. Display all information from dept table
3. Display only employees working in dept 10
4. Display employees working in dept 20
5. Display employees working in dept 40
6. Display all the employees in descending order of their salary
7. Find out how many types of jobs are there in emp table
8. Find out how many mgr are there in emp table
9. Find out how many deptnos are there in emp table
10. Display all the Clerks
11. Display all the SALESMAN's only
12. Display all employees in ascending order of thei jobs and descending order of their deptnos
13. Display all Salesman's only in descending order of their salaries
14. Display all Employees with New Headings for them (decide your own headings)
15. find the position of second a in string  ‘rajkumarr’.
16.find the position of third r in string ‘rajkummarr’.
17.find all employee name whose name contains atleast one N.
18.find all the employees who don’t have commision;
19.find all the employee’s annual salary including there commision;
20.write query to find the employee id whose salary is between losal and hisal of salgrade table.
21.Replace the string ‘bl’ from  ‘black’ with ‘j’.
22.find the employee’s name and id whose have same manager.
23.find the maximum salary for all dept.
24.find the minimum salary for dept no 10.
25.find the maximum and minimum salary for each department where the maximum salary is greater than 5000 and minimum salary is greater then 2000.
26.Increase salary by 10% for employee who is the oldest in company.
27. decrease salary if the job is analyst by 50% and having no commision.
28.decrease or increase salary if the job is
SALESMAN   by 10(decrease)
PRESIDENT  by 1(increase)
MANAGER  by3(decrease)
ANALYST  by 8(increase).

29. Display all employees who joined in DEC

30 Display all those employees who did not join in DEC


31.Display no of employees who joined in DEC


No comments:

Post a Comment