Practical Question Bank
Practical Question Bank
Sup_No
Sup_Name Item_Supplied Item_Price City
(Primary Key)
S1 Suresh Keyboard 400 Hyderabad
S2 Kiran Processor 8000 Delhi
S3 Mohan Mouse 350 Delhi
S4 Ramesh Processor 9000 Bangalore
S5 Manish Printer 6000 Mumbai
S6 Srikanth Processor 8500 Chennai
1. Write sql query to display Supplier numbers and Supplier names whose name
starts with ‘R’
2. Write sql query to display the name of suppliers who supply Processors and
whose city is Delhi.
3. Write sql query to display the names of suppliers who supply the same items
as supplied by Ramesh.
4. Write sql query to increase the price of Keyboard by 200.
5. Write sql query to display supplier numbers, Supplier names and item price for
suppliers in delhi in the ascending order of item price.
6. Write sql query to add a new column called CONTACTNO.
7. Write sql query to delete the record whose item price is the lowest of all the
items supplied .
8. Create a view on the table which displays only supplier numbers and supplier
names.
9. Write sql query to display the records in the descending order of item price for
each item supplied.
10.Write sql query to display the records of suppliers who supply items other than
Processor or Keyboard.
Sinhgad Technical Education Society’s
SINHGAD COLLEGE OF ENGINEERING, PUNE
Department of Information Technology
Practical Question Bank
Class: S.E. Database Management System Lab
B. Below are the details of Employees working for a software Company. (For
questions from 1 to 10) Create the table called EmpDetails with the below
mentioned 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
E103 Payal 15-Aug-85 Tester 35000 13-Jun-11
E104 Kiran 20-Apr-90 Programmer 40000 7-Mar-14
E105 Meenal 29-May-83 DBA 50000 9-Dec-11
E106 Sheila 1-May-70 Analyst 60000 25-Sep-18
E107 Swamy 13-Jan-85 Programmer 45000 14-Feb-16
E108 Sushma 22-Dec-76 DBA 45000 31-Jan-12
C. Create the two tables as shown below with the given constraints: (for questions 1
to 10)
Table name: Employee
Constraints: Eid is Primary key and DeptId is foreign key
Salary should not be less than 10000
DeptId
Eid Salary
Ename (Foreign Designation DOJ
(Primary Key) ( > 10000)
Key)
101 Sudha D2 Clerk 20000 01-Apr-10
102 David D1 Manager 50000 18-Feb-18
103 Preethi D3 Clerk 35000 13-Jun-11
104 Kiran D1 Salesman 20000 7-Mar-14
105 Meenal D2 Clerk 50000 9-Dec-11
106 Sunitha D3 Manager 60000 25-Sep-18
107 Akhil D3 Clerk 25000 14-Feb-16
108 Sushma D2 Manager 45000 31-Jan-12
Tablename: Department
Constraints:DeptId Primary key and Dname is NOT NULL
DeptId Dname
(Primary Key)
D1 Sales
D2 Marketing
D3 Finance
1. Write sql query to display all the employees who earn more than average
salary of all the employees in the company.
2. Write sql query to display the fields Eid, Ename and Dname.
3. Write sql query to sort the employee table in the descending order of
salaries.
4. Write sql query to list all the job designations in the employee table
without repetitions.
Sinhgad Technical Education Society’s
SINHGAD COLLEGE OF ENGINEERING, PUNE
Department of Information Technology
Practical Question Bank
Class: S.E. Database Management System Lab
5. Write sql query to display all the employee details Department wise and in
the ascending order of their salaries.
6. Write sql query to display all the clerks in DeptId D2.
7. Write sql query to display all the employees who joined in the year 2011.
8. 28. Write sql query to display all the employees who joined in the month of
February.
9. Write sql query to display all the employees whose salary is between
30000 and 45000.
10. Write sql query to display all the employee details along with their work
experience in the company till current date.
Sinhgad Technical Education Society’s
SINHGAD COLLEGE OF ENGINEERING, PUNE
Department of Information Technology
Practical Question Bank
Class: S.E. Database Management System Lab
D. Below are the details of Students enrolled in various course of B.Com (For
questions from 1 to 10) Create the table called Student with the below mentioned
details.
Sid
(Primary Sname DOB State Gender Category Course
Key)
1001 Neha 29-Dec-02 Telangana F Gen Comp
1002 Arun 10-Jan-02 Telangana M OBC Honors
1003 Payal 15-Aug-01 Maharashtra F Gen Appl
1004 Amrita 20-Apr-02 Karnataka F OBC Honors
1005 Pavan 29-May-03 AndhraPradesh M ExServicemen Comp
1006 Anchal 1-May-03 Gujarat F OBC Comp
1007 Ramya 13-Jan-02 Telangana F Gen Appl
1008 Rakesh 22-Dec-01 AndhraPradesh M Sports Comp
1. Write sql query to display the students who are not from Telangana or
AndhraPradesh.
2. Create a view to display the columns Sid, Sname for students belonging to
Telangana.
3. Write sql query to create an index on column Sname.
4. Write sql query to display all the female students enrolled under Comp course
and who belong to OBC.
5. Write sql query to display the student ids, names, and their present age.
6. Write sql query to display the students in the ascending order of their names
for each course.
7. Write sql query to delete all the students records who have enrolled for Comp
course and who are born after 2002.
8. Write a sql query to add two new columns Contactno and Email to the
existing fields.
9. 39. Writs an sql query to display all the Student names prefixed with Mr./Ms.
Based on Gender column.
10. Write an sql query to display all the Student names where the length of the
name is 5 characters.
Sinhgad Technical Education Society’s
SINHGAD COLLEGE OF ENGINEERING, PUNE
Department of Information Technology
Practical Question Bank
Class: S.E. Database Management System Lab
BookId
Date
(Primary BookName Author Publisher Price
Purchased
Key)
B101 Cost Accounting Jain Narang 11-Feb-13 Kalyani 800
B102 Business Statistics OP Aggarwal 22-Dec-11 Himalaya 750
B103 Rdbms C J Date 2-Mar-15 TMH 900
B104 Mgmt Accounting RK Sharma 19-Apr-16 Kalyani 450
B105 Operating Systems Galvin 25-Nov-13 PHI 750
B106 Advanced Accounting SC Gupta 16-Apr-18 Himalaya 600
1. Write sql query to display the list of authors from Himalaya publications.
2. Write sql query to display the total cost of books purchased Publisher wise.
3. Write sql query to count the total number of books under Kalyani
publications.
4. Write sql query to rename the column Publisher as Publications.
5. Write a sql query to display the books in the ascending order of
DatePurchased.
6. Write sql query to create an index on the fields BookName and Author.
7. Write sql query to display the books whose price is between 500 and 700
8. Write sql query to increase the price of all the books by 200 for publishers
other than Himalaya or Kalyani.
9. Write sql query to display the book details where author name contains the
name Sharma.
10. Create a view to display the fields BookId and BookName where the Publisher
is Himalaya.