Rdbms - Practical Questions
Rdbms - Practical Questions
Total Marks:35
A.Create a Supplier table as shown below : (for questions from 1to 10)
1. Write sql query to display Suplier numbers and Supplier names whose name starts with 'R
2. Write sql query to display the name of suppliers whosupply Processors and whose city is Delhi.
3. Write sql query to dispiay the names of suppliers wh0 supply the same items as supplied by Ramesh.
S. Write sql query to display supplier numbers, Suplier names and itemprice for suppliers in delhi in the
ascending order of itemprice.
7. Write sql query to delete the record whose itemprice is the lowest of all the items supplied
8. Create a view on the table which displays ornly supplier numbers and
supplier names.
9. Write sqlquery to display the records in the
descending order of itemprice for each itemsupolied.
10. Write sai query to display the records of suppliers who
supply items other than Processor or
Keyboard.
Company. (For questions from 11toz0)
B. Beiow are the details of Employees working for asoftware
Create the table called EmpDetails with the belowmentioned details.
Eid Ename DOB Designation Salary DOJ
(Primary Key)
E101 Suma 29-Dec-89 Designer 20000 01-Apr-10
E102 Amit 10-Jan-95 Programmer 25000 18- Feb-18
is Programmer.
11. Write sqiquery to display all the employees whose designation
joined after 2014.
12. Write sql query todispiay employees who have
name ends with 'a'.
13. Write sql query to display allthe employees whose
employees whose designation is
14. Write sql query to display the total salary of all the
programmer.
case.
15. Write sql query to displayall the employee names in upper
experience.
16. Write sql query todisplay the details of the employee with highest
name contains 'ee'.
17. Write sql query to display the details of the empioyees whose
whose designation is DBA.
18. Write sql query toincrease the salaries of empioyees by 5000
average salary of all the
19. Write sql query to display the empioyees whose salary is more than the
employees.
20. Write sql query to display the record in the following format:
XXXXXXXXx is working as xXXXXXXXXXXXXX with a Salary ofRs.xxXXXXXX
Constraints: Eid is Primary key and Deptid is foreign key Constraints:Deptld Primary key
Salary should not be less than 10000 and Dname is NOT NUL
(Primary Key)
1001 Neha 29-Dec-02 Telangana Gen Comp
1002 Arun 10-Jan-02 Telangana M OBC Honors
31. Write sqlquery todisplay the students who are not from Telangana or AndhraPradesh.
32.Create aview to display the columns Sid, Sname for students belonging to Telangana.
33. Write sql query to create an index on column Sname.
34. Write sql query to display all the female students enrolled under Comp course and who belong
to OBC.
35. Write sqlquery to display the student ids, names, and their present age.
36.Write sqiquery to display the students in the ascending order of their names for each course.
37. Write sql query todelete all the students records who have enrolled for Comp course and who
are born after 2002.
38. Write asql query to add two new columns Contactno and Email to the existing fields.
39. Writs an sqlquery to display allthe Student names prefixed with Mr./Ms. Based on Gender
column.
40. Write an sqlquery to display all the Student names where the length of the name is 5 characters.
E. Create a Table for Library Information: (for questions from 41 to 50)
Table name:Library
(Primary Key)
11-Feb-13 Kalyani 800
B101 Cost Accounting Jain Narang
OP Aggarwal 22-Dec-11 Himalaya 750
8102 Business Statistics
2-Mar-15 TMH 900
Rdbms C Date
B103
Kalyani 450
Mgmt Accounting RK Sharma 19-Apr-16
B104
25-Nov-13 PHi 750
Operating Systems Galvin
B105
16-Apr-18 Himalaya 600
B106 Advanced Accounting SC Gupta
Himalaya publications.
41. Write sqiquery to display the list of authors from
of books purchased Publisher wise.
42. Write sql query todisplay the total cost
number of books under Kalyani publications.
43. Write sqiquery to count the total
query to increase the price of all the books by 200 for publishers other than Himalaya or
48. Write sql
Kalyani.
author name contains the name Sharma.
49. Write sqlquery to display the book details where
where the Publisher is Himalaya.
50. Create a view to display the fields Bookid and BookName