DBMS Lab

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

GCU Lahore Max Allowed time: 120 Mins Max Marks:50

RollNo____________________ Name________________________Section:______________

INSTRUCTIONS
 Internet connectivity and electricity backup is responsibility of student himself.
 The paper time will be from 11:00 AM to 01:00 PM.
 All questions are compulsory.
 Write query in your IDE (query pane) and paste the same into a Word/ Pdf file along-with appropriate query number as
mentioned in the paper.
 Mention your name, roll no. and section on each page.
 You have to submit the paper on the following link

https://www.dropbox.com/request/JqSZMo6e93Fm6Dpox67V

 Group submission is not allowed. Each student has to submit paper individually.
 The file name (single Pdf file or zip file) must contain your complete roll number, name, Subject name (DBS-LAB) (e.g.
000-BSCS-18,Your Name,A,DBS-LAB)
 All questions are based on HR Schema available in Oracle by default and has been provided and implemented in MS-SQL
Server.

Final Term Exam May .2021 DBS LAB


GCU Lahore Max Allowed time: 120 Mins Max Marks:50
RollNo____________________ Name________________________Section:______________

Final Term Exam May .2021 DBS LAB


GCU Lahore Max Allowed time: 120 Mins Max Marks:50
RollNo____________________ Name________________________Section:______________

All the queries are mandatory.

Write queries by considering the provided HR Schema


1. Enlists all the employees whose First Name starts with ‘S’ (4)
2. Enlist the Employees who have got at least 06 years of experience in the company (4)
3. Select number of employees who have been promoted exactly twice since they have been hired (4)
4. Create a view that displays departments who have not been assigned any manager (4)
5. Display Manager name, Department Name, the manager name should be a concatenated form of first name and last
name (4)
6. Delete employees who are working in Marketing department (4)
7. Increase the salaries by 10%, of those employees who are getting less than 5000 salaries. (4)
8. Display names of all departments along with only those employees (names) who work in any department (4)
9. Create a view where we have year-wise, and designation wise number of employees hired in the company (4)
10. Insert a record into Employee table using a parameterized stored procedure. (4)

11. Modify the existing HR schema, where we store the certification of the employees he/she has done. The attribute of
the certification would be Certification ID, Certification Title, Start Date and Completion Date. An employee can
complete many certificate and a certificate can be completed by many employees. (10)

a. Carefully analyze the requirements and create relational model of this scenario. (4)
b. Create tables without any constraint. (2)

Final Term Exam May .2021 DBS LAB


GCU Lahore Max Allowed time: 120 Mins Max Marks:50
RollNo____________________ Name________________________Section:______________

c. Add constraint of unique key and not null on columns “certification title”,” start date” and “completion date”
(this would be done after creating tables). (2)

d. Implement/add proper primary keys and foreign keys. All constrains should be properly named. (2)

Final Term Exam May .2021 DBS LAB

You might also like