0% found this document useful (0 votes)
2K views

DBMS Lab Final Exam

The document provides instructions for a database management systems exam, including two questions to be completed. For question 1, students are asked to create tables based on requirements, identify primary keys, add primary key constraints, identify foreign keys, and add foreign key constraints. They are also asked to generate and submit a script of the database. For question 2, students are asked to write 8 SQL queries on the HR schema, including queries to retrieve employee details, filter locations data, filter and sort employee data, and use functions like substring and upper/lower case conversion.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views

DBMS Lab Final Exam

The document provides instructions for a database management systems exam, including two questions to be completed. For question 1, students are asked to create tables based on requirements, identify primary keys, add primary key constraints, identify foreign keys, and add foreign key constraints. They are also asked to generate and submit a script of the database. For question 2, students are asked to write 8 SQL queries on the HR schema, including queries to retrieve employee details, filter locations data, filter and sort employee data, and use functions like substring and upper/lower case conversion.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Database Management System (Practical)

Time Duration :2 hours Dated :22 Jan 2021

INSTRUCTIONS DURING THE EXAM

1. There will be two questions and you have to attempt both.


2. Read the statements of questions carefully before writing answer.
3. Total Marks: 30
4. Time Duration: 2:30 PM to 4:30 PM
5. In .docx file, there should be 2 headings for each Task. Heading 1 for query, Heading 2
for task’s output screenshot which will be the whole window.

For Example, for each task these follow the following format:
Question 1 - Task 1

Your query

Output Screenshot

Attach output screenshot

6. Once you have completed all the task, make a pdf of your solution file.
7. Copy all your submission files (.docx, ,pdf, and .sql) in a folder. The name of that
folder should be like RollNumber-Name-Section.
(For example: 222-BSCS-18-Ahmad-E1)
8. Compress the above folder in (.zip, .tar, or .rar) format with the same name and submit
on the submission link that has been shared with you.
9. Late submission will be marked/graded ZERO.
10. Do not copy anything from others. Your document, output screenshot must be unique.
Plagiarized content will also be marked as ZERO.

BEST OF LUCK!
Question 1 (10 Marks)
Requirements:

Tasks:

1. Write Queries to create above tables in Database. (Important Note: Name of the database must be
your roll number in which you will create the tables) (2 marks)
2. List the attributes from the above tables which should be marked as primary keys? (1 marks)
3. Write query to Alter the above tables and add primary constraints to the attribute that you justified in
above question. Copy and Paste script for adding constraint of primary key in all tables here:(2 marks)
4. Identify the attributes in each table that can be classified as a foreign key (2 marks)
5. Write Query to update above tables to add foreign key constraint to the attributes that you specified in
above question. Execute query in your database (2 marks)

6. Generate script of the above database. Save it with the same name as database name. And send it
along with the solution that you will submit. (1 mark)
Question 2 (20 Marks)

USE HR Schema to perform the following tasks:

1. Display all the details of employees who ended job at 19 Dec-07. (2 marks)
2. Select all fields from "LOCATIONS" where country ID is "UK" AND city must be "OXFORD" OR
"MUNICH" (use parenthesis to form complex expressions) (2 marks)
3. Write a query in SQL to display all those employees whose first name starts with letter P and ends with
letter k or the seventh digit in their phone number equals 3 and make the result set in a descending order
by the first name. (2 marks)
4. Write a query in SQL to display the full name (first and last name), department name, job title and city
of employee whose ID is 100. (2 marks)
5. Write a query in SQL to display the full name (first and last) and salary for those employees who earn
less than the employees whose Id is 182. (3 marks)
6. Display the country name and number of cities in each country. (3 marks)
7. Display the first name, salary, email and department name of employees working in ‘Tokyo’ city. (3
marks)
8. Write script for following: (3 marks)
a. Fetch the substring Relational from string 'Oracle Database is an Relational Database ' (1)
b. Display the first name of employees in upper case, lower case and initcap case (1)
c. Fetch the position of sub string RDBMS 'Oracle Database is an RDBMS ' (1)

OR

Write a query to create a VIEW that will display the employee name, salary, department name, city,
country, and region name using Joins.

You might also like