0% found this document useful (0 votes)
22 views4 pages

SQL Practice Quries51

The document consists of a list of SQL queries and scenarios that involve various database operations such as selecting, inserting, updating, and deleting records. It covers tasks like printing employee details, handling duplicates, performing joins, and querying data dictionary information. The queries are designed to manipulate and retrieve data from tables with specific conditions and requirements.

Uploaded by

manoj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views4 pages

SQL Practice Quries51

The document consists of a list of SQL queries and scenarios that involve various database operations such as selecting, inserting, updating, and deleting records. It covers tasks like printing employee details, handling duplicates, performing joins, and querying data dictionary information. The queries are designed to manipulate and retrieve data from tables with specific conditions and requirements.

Uploaded by

manoj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

1.

Remove only middle * From below


****Hello****World****

2. Print Next sunday


3. Print first day of month
4. Print date , month, year in different columns from sysdate.
5. Generate numbers from 1 to 10
6. Generate next 5 days and print the dates.
7. Print Even number of rows from a table.
8. Print odd number of rows from a Table.
9. print first 3 rows from a table
10. print last 3 rows from table
12. print first 3 and last 3 rows from a table in a single query
13. print department wise employees count
14. print 3 rd maximum salary with using analytical function and without
using analytical function
15. print 3 rd minimum salary
16. print maximum salary from each department.
17. print middle record from the table
18. print n th record of the table. (atleast 2 methods of output
required)
19. print duplicate records from the table (with and without using
analytical functions)
20. delete duplicate records from the table
21. scenario:
employees
Empid Empname
1 x
2 y
3 z

Emp_Detail
Empid address
1 addr1
2 addr2
1 addr3
2 addr4
3 addr5

22. print Empid , empname From above table who are all having multiple
addresses
23. print Empid , empname From above table who are all having single
address.
24. Table t1 having records from 1 to 10, But some of records are missing
from T1
Print missing records from t1.
25. Print first_name, department_name , city From Employees ,
departments, locations Tables
26. Print Employee details Who are all getting salary more than avg of
salary from their own department.
27. scenario
Table t1
Col a
1
2
3
4
5
Table t2
Col b
3
4
5
6
Print inner join, left outer, right outer , full outer , and cross
join output of these tables.
28. I have to insert records to t2 from t1 , But That insert statement
should not insert duplicates.
29. I have to delete records from t1 which are not available in t2 (3
methods of output required)
30. I have to insert record to t1 but it should not accept duplicates.
eg: If i insert record 10 into t1 table, record 10 should get insert
into t1 only one time , even if Im executing the insert
statement multiple times.

31. Select records from t2 which are not available in t1 (3 methods ,


join , in/ not in , Exists/ not exists )
32. scenario
Table T1
1
1
1
1
1
Table t2
1
1
1
Need Output for Inner join, left , right, full outer and cross join

33. Table t1
0
1
1
Table t2
1
1
0
Need Output for Inner join, left , right, full outer and cross join
34. Print employee name and his manager name in single query
35. Table t1
id name
1 x
2 y
3 z

Table t2
id name
1 null
2 null
3 null
update name column from t2 with respect to id from t1 table
36. find how many "e" available in the below word
enterprise

37. Write a query to find a column having index or not (data dictionary)
38. Write a query to print index name , column name and its table name
(data dictionary)
39. write a query to list table names and its record count (data
dictionary)
40. write a query to list child table names from the given table name
(data dictionary)
41. write a query to find a column having constraint or not ? (data
dictionary)
42. write a query to find gt tables from user_Tables (data dictionary)
43. write a query to find exernal tables from user_Tables (data
dictionary)
44. table t1
1
2
3
4
5
6
Table t2
no records available
What is output for Inner join, left , right, full outer and cross join
45. print employee names who are all getting salary higher than their
manager.
46. print employees who are all having more experience from their own
manager.
47.
Table : emp Table : Emp details
Empid Empname Empid joining_date Relieving_Date
Print employee details only for active employees .
48. Table : t1 Table t2 t3
Eid Ename did Did dname loc_id loc_name dept_id

I need a qry , it must display eid, ename, did, dname, loc_name


t3 no records avaialble.

Even t3 doesnt have any records then , I need to see records other
than loc_name
here loc_name can be null.
If i insert proper records to t3 table, It must show expectd output
including loc_name.

49. Table Car:


swift
i10
Tata
Table color:
Black
white
Red

write query to release all cars in all colurs


50. what is the output of
Select (2,10 ) From dual;

You might also like