You are on page 1of 3

FACULTY OF ENGINEERING, SCIENCE & TECHNOLOG

Final Exam Spring - 2020


Subject: DataBase Management Systems Lab Instructor: Aqdas Hassan

Date: Max. Marks: 40

Question no 01: [25 Marks]


Create a database using SQL with the following instructions.
Note: Please make sure that all the points/rules must be implemented.
 Choose your own real time database scenario
Example:
1. Online payment system
2. Online ticket system
3. Travel agency
4. Online food delivery service
5. Banking system
Requirements:
1. ER Diagram of system implemented in tool such as Draw.io & DIA (Available online).
(10 Marks)
2. Create all tables presented in ERD). (5 Marks)
3. INSERT data into tables). (5 Marks)
4. Make ER relationships using joins. (5 Marks)
5. Also make sure to have the primary keys and foreign keys clearly defined.
6. System must perform all operations such as searching of particular data, insert of new
record, delete, and update.

Page 1 of 3
This study source was downloaded by 100000847731645 from CourseHero.com on 06-01-2022 22:38:50 GMT -05:00

https://www.coursehero.com/file/78754146/DBMS-LAB-FINAL-PAPERdocx/
1-Example of ERD:

Question no 02: [15 Marks]


Create Database : Records

Create Table : Emp


EmpNo EName Job ManagerNo HireDate Salary Commission DeptNo
(Not (Not Null) (Not Null) (Not Null) (Not (Not
Null, Null, Null)
unique) >1000)
1001 Gohar Salesman 512 18-Dec-11 1600 400 20

1002 Ahmed Clerk 511 28-Nov-11 1250 10

1003 Shahid Manager 505 11-Jun-11 10000 20

1004 Toqeer Salesman 512 15-Dec-10 2700 300 20

1005 Asif Manager 505 18-Dec-10 12000 15

1006 Babar Salesman 512 14-Nov-10 4000 500 20

1007 Kashif President 21-Oct-10 20000 10


1008 Zubair Manager 505 8-Dec-09 15000 10
1009 Yasir Clerk 511 18-Dec-09 1650 15

1010 Salman Salesman 512 10-May-09 5300 700 20


1011 Hafeez Clerk 511 1-Jan-09 1500 15

Page 2 of 3
This study source was downloaded by 100000847731645 from CourseHero.com on 06-01-2022 22:38:50 GMT -05:00

https://www.coursehero.com/file/78754146/DBMS-LAB-FINAL-PAPERdocx/
Perform the following queries for above table:
1. Write a query to display maximum, minimum, sum and average of salaries.
2. List all records with EName, Salary, Commission and Total Salary after commission.
3. Delete the third row from the table Epm.
4. Show all records in descending order with respect to Ename.
5. How many records do we have?
6. Add Column Bonus Salary in Emp Table.
7. Write a query to find Ename whose Ename Start with ‘A’ and 'S'.
8. Update the EName (Emp table) as Charlie where EmpNo is 1004.
9. Write a query to find all Ename with ManagerNo as “505” and 512“.
10. Write a query to find all Ename where Job is salesman.
11. List all ‘Salesman’ and add 500 to their salaries, also change the column heading to
Salary With Bonus.
12. Write a query to find unique jobs from the Emp table.
13. List all employees who are either manager or salesman.
14. Show all records whose salary is more than 2000 and less than 6000.
15. write a query to find How many jobs do we have?

Page 3 of 3
This study source was downloaded by 100000847731645 from CourseHero.com on 06-01-2022 22:38:50 GMT -05:00

https://www.coursehero.com/file/78754146/DBMS-LAB-FINAL-PAPERdocx/
Powered by TCPDF (www.tcpdf.org)

You might also like