0% found this document useful (0 votes)
166 views2 pages

DB Final Exam Summer 20201 PDF

This document provides instructions for a final paper assignment for a Database Systems course. It includes 4 questions asking students to perform database normalization, write SQL queries to create a table and insert data, derive attributes, and perform operations like selecting, sorting, joining, and deleting data across two sample tables. Students are instructed to write their responses in MS Word and submit as a PDF. The assignment is out of 50 total marks.

Uploaded by

Danish Ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
166 views2 pages

DB Final Exam Summer 20201 PDF

This document provides instructions for a final paper assignment for a Database Systems course. It includes 4 questions asking students to perform database normalization, write SQL queries to create a table and insert data, derive attributes, and perform operations like selecting, sorting, joining, and deleting data across two sample tables. Students are instructed to write their responses in MS Word and submit as a PDF. The assignment is out of 50 total marks.

Uploaded by

Danish Ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Final Paper Summer 2020

Course Title: Database Systems


Instructor: Rimsha Khan
Total Marks: 50

NOTE: Understanding the paper is part of solving the paper so no questions will be
entertained.
INSTUCTIONS:
1. Write your names and IDs at top of each paper.
2. Write queries on MS Word. No tool required.
3. Convert word to pdf after uploading.

Q1: Perform Normalization upto 3rd Normal Form on the following table.
(13marks)
Student_id Student Student Course_ID Course_Name Grade
Name Address
01 Fawad Karachi SE-01 AI A
SE-05 SQE B
02 Waleed Lahore SE-02 DIP C
03 Saira Peshawar SE-03 DB A
SE-04 SRE B
04 Aiman Karachi SE-03 DB C
05 Daniyal Lahore SE-01 AI A
06 Emaan Peshawar SE-01 AI B

Q2: Write SQL queries for the following DDL Statements


1. Write a query to create a table by the name Students which should have
the following columns and restrictions: (Marks 10)
Column Name: ID Type: integer
Column Name: Student_Name Type: varchar
Column Name: DOB Type: DATE
Column Name: Age Type: Integer
Column Name: CGPA Type: float
Restrictions: ID should be the primary key. Student_Name should also be
NOT NULL. Maximum value of age should be 30 years.
2. Write 2 SQL DML Queries to insert your data and your friend’s data in this
Table. (4 marks)
3. Which of the given attributes is a derived attribute and from which
attribute it can be derived? (5 marks)
Q3: Consider you have the following 2 tables.
Canteen_Table
Product_ID Product_Name Category Mfg_Date Exp_Date Unit Price
01 Dairy milk Junk 2, Aug 2019 2, Aug 2020 80 Rs
Chocolate
02 Lipton Tea bags Not Junk 2 Jan 2019 2 Jan 2020 160 Rs
03 Kurkure Junk 2 April 2019 2 April 2021 30 Rs
04 Shezan Juice Junk 3 Aug 2019 3 Aug 2020 30 Rs
05 Chilli Milli Jelly Junk 3 Jan 2018 3 Jan 2021 5 Rs
06 Olpers Milk Not Junk 3 April 2018 3 April 2020 350 Rs

Order_Details
Order_Id Product_ID Unit Price Quantity
01 02 160 Rs 1
01 06 350 Rs 1
02 01 80 Rs 2
02 03 30 Rs 2
02 05 5 Rs 2

1. Write SQL Query for finding/displaying product names and ids of products
whose unit price is less than 50 Rs. (4 Marks)
2. Write SQL Query for displaying sorted names of product names with Alias
name as Product_List_Sorted. (5 Marks)
3. Delete data from Order_Details whose quantity is less than 1. (4 marks)
4. Write SQL INNER JOIN query and its output on the given two tables. (5
marks)

**********************************Good Luck*********************************

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy