-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquestions.sql
More file actions
122 lines (56 loc) · 4.84 KB
/
questions.sql
File metadata and controls
122 lines (56 loc) · 4.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
-- Q-1. Write an SQL query to fetch “FIRST_NAME” from Worker table using the alias name as <WORKER_NAME>.
-- Q-2. Write an SQL query to fetch “FIRST_NAME” from Worker table in upper case.
-- Q-3. Write an SQL query to fetch unique values of DEPARTMENT from Worker table.
-- Q-4. Write an SQL query to print the first three characters of FIRST_NAME from Worker table.
-- Q-5. Write an SQL query to find the position of the alphabet (‘b’) in the first name column ‘Amitabh’ from Worker table.
-- Q-6. Write an SQL query to print the FIRST_NAME from Worker table after removing white spaces from the right side.
-- Q-7. Write an SQL query to print the DEPARTMENT from Worker table after removing white spaces from the left side.
-- Q-8. Write an SQL query that fetches the unique values of DEPARTMENT from Worker table and prints its length.
-- Q-9. Write an SQL query to print the FIRST_NAME from Worker table after replacing ‘a’ with ‘A’.
-- Q-10. Write an SQL query to print the FIRST_NAME and LAST_NAME from Worker table into a single column COMPLETE_NAME.
-- A space char should separate them.
-- Q-11. Write an SQL query to print all Worker details from the Worker table order by FIRST_NAME Ascending.
-- Q-12. Write an SQL query to print all Worker details from the Worker table order by
-- FIRST_NAME Ascending and DEPARTMENT Descending.
-- Q-13. Write an SQL query to print details for Workers with the first name as “Vipul” and “Satish” from Worker table.
-- Q-14. Write an SQL query to print details of workers excluding first names, “Vipul” and “Satish” from Worker table.
-- Q-15. Write an SQL query to print details of Workers with DEPARTMENT name as “Admin*”.
-- Q-16. Write an SQL query to print details of the Workers whose FIRST_NAME contains ‘a’.
-- Q-17. Write an SQL query to print details of the Workers whose FIRST_NAME ends with ‘a’.
-- Q-18. Write an SQL query to print details of the Workers whose FIRST_NAME ends with ‘h’ and contains six alphabets.
-- Q-19. Write an SQL query to print details of the Workers whose SALARY lies between 100000 and 500000.
-- Q-20. Write an SQL query to print details of the Workers who have joined in Feb’2014.
-- Q-21. Write an SQL query to fetch the count of employees working in the department ‘Admin’.
-- Q-22. Write an SQL query to fetch worker full names with salaries >= 50000 and <= 100000.
-- Q-23. Write an SQL query to fetch the no. of workers for each department in the descending order.
-- Q-24. Write an SQL query to print details of the Workers who are also Managers.
-- Q-25. Write an SQL query to fetch number (more than 1) of same titles in the ORG of different types.
-- Q-26. Write an SQL query to show only odd rows from a table.
-- select * from worker where MOD (WORKER_ID, 2) != 0;
-- Q-27. Write an SQL query to show only even rows from a table.
-- Q-28. Write an SQL query to clone a new table from another table.
-- Q-29. Write an SQL query to fetch intersecting records of two tables.
-- Q-30. Write an SQL query to show records from one table that another table does not have.
-- MINUS
-- Q-31. Write an SQL query to show the current date and time.
-- DUAL
-- Q-32. Write an SQL query to show the top n (say 5) records of a table order by descending salary.
-- Q-33. Write an SQL query to determine the nth (say n=5) highest salary from a table.
-- Q-34. Write an SQL query to determine the 5th highest salary without using LIMIT keyword.
-- Q-35. Write an SQL query to fetch the list of employees with the same salary.
-- Q-36. Write an SQL query to show the second highest salary from a table using sub-query.
-- Q-37. Write an SQL query to show one row twice in results from a table.
-- Q-38. Write an SQL query to list worker_id who does not get bonus.
-- Q-39. Write an SQL query to fetch the first 50% records from a table.
-- Q-40. Write an SQL query to fetch the departments that have less than 4 people in it.
-- Q-41. Write an SQL query to show all departments along with the number of people in there.
-- Q-42. Write an SQL query to show the last record from a table.
-- Q-43. Write an SQL query to fetch the first row of a table.
-- Q-44. Write an SQL query to fetch the last five records from a table.
-- Q-45. Write an SQL query to print the name of employees having the highest salary in each department.
-- Q-46. Write an SQL query to fetch three max salaries from a table using co-related subquery
-- DRY RUN AFTER REVISING THE CORELATED SUBQUERY CONCEPT FROM LEC-9.
-- Q-47. Write an SQL query to fetch three min salaries from a table using co-related subquery
-- Q-48. Write an SQL query to fetch nth max salaries from a table.
-- Q-49. Write an SQL query to fetch departments along with the total salaries paid for each of them.
-- Q-50. Write an SQL query to fetch the names of workers who earn the highest salary.