Sie sind auf Seite 1von 4

Bahauddin Zakariya University Multan

Department of Information Technology


Final Term Examination
Subject: Database Systems
Class: BSIT (Evening) Semester: 5th
Paper Type: Subjective Date: 25-01-2021
Time Allowed:
Instructor 2 Hours 30 Minutes
Muhammad Kashif
Name:
Reg no
Student Name:
Max. Marks 50

Paper Instructions

1. Submit your paper on this provided link in PDF format.

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

2. You are only allowed to submit only a PDF file.


3. Only handwritten paper will be accepted.
4. Plagiarism will decrease your marks.
5. Only 30 minutes are allowed to convert handwritten paper to PDF format.

Question No 1: 15 Marks

1. Describe the difference between NOSQL and Relational Database. (3)


2. Describe the difference between clustering and primary indexing. (3)
3. Describe the difference between Unique and Primary key. (3)
4. Describe the transitive dependency and how to resolve it? (3)
5. Describe the difference between Role Forward and Role backward transaction. (3)

Question No 2: 10 Marks

We are designing a schema for a TV show and you have to record the following information:

For each show we have to record its name, genre and participants name. Also record some basic information
which is necessary. Each show has more than one participants. A producer produces only one show and
show is produced by on producer. Producer belongs to a company and company belongs to a country. A
television can broadcast many shows but a show can be broadcasted by only one television. Television has
a name, head office and starting year. A viewer can rate multiple shows and shows also can be rated by
multiple viewers. Rating score range is 0 to 10. Viewers has a username, password and age.

1. Identify entities and their attributes and state attribute types, (i.e. unique, composite, etc.);
(2)
2. Identify relationships, their attributes (if any) and structural constraints; (2)
3. Draw partial ER diagrams showing each entity and all its attributes individually; (3)
4. Draw a simplified ER diagram showing all entities, the relationships between them
(including structural constraints, and relationship attributes (if any)). (3)

Question No 3: 25 Marks

Consider given Database with sample data.

Table 1:customer

customerNo customerName customerPhone customerAddress centerNo


1 Jhony (555) 555-2234 23 street North New York 1
2 Lara (555) 555-2256 1 street South SF 3
3 Jimmy (555) 555-2298 12 street North SF 2
4 Carry (555) 555-2434 9 street west SF 2
5 Cruse (555) 555-2234 4 street North LA 1
6 monty (555) 555-2256 13 street South LA 2
7 hennry (555) 555-2298 4 street North LA 3
8 victoria (555) 555-2434 7 street west LA 2
9 Nora (555) 555-1254 8 street North New York 1
10 Hana (555) 555-5256 12 street South New York 1
11 Lussy (555) 555-5298 7 street North New York 4
12 Toronto (555) 555-5434 9 street west New York 4
Table 2:center

centerNo Location centername


1 New York Glam Cars NY
2 Los Angles Glam Cars LA
3 Chicago Glam Cars C
4 San Francisco Glam Cars SF
Table 3:Saleperson

salepersonNo salepersonName salepersonPhone salepersonAddress centerNo


1 Jhon (555) 555-1234 9 street North New York 1
2 Methew (555) 555-1256 12 street South New York 1
3 Salena (555) 555-1298 2 street North New York 1
4 Sara (555) 555-3434 14 street west New York 1
5 Sasha (555) 555-8811 12 street North LA 2
6 Katrin (555) 555-2134 10 street South LA 2
7 Anglena (555) 555-5678 16 street North LA 2
8 Suzan (555) 555-9909 5 street west LA 2
9 Rock (555) 555-8812 12 street North Chicago 3
10 Tom (555) 555-2133 10 street South Chicago 3
11 Jerry (555) 555-5674 16 street North Chicago 3
12 Emily (555) 555-9905 5 street west Chicago 3
13 Alex (555) 555-4674 16 street North SF 4
14 Amilia (555) 555-4905 5 street west SF 4
Table 4:Carsale

SalesN agreedpric commissio intitialde SaleTyp salepersonN


saleDate Instalmentduration customerNo
o e n posit e o
1 6000 2020-11-22 180 6000 sold NULL 1 2
2 4000 2020-11-21 80 1000 hired NULL 2 1
3 12000 2020-12-16 480 6000 sold NULL 3 3
4 10000 2020-11-12 300 6000 sold 2 4 4
5 8000 2020-12-18 240 6000 hired NULL 2 5
6 9000 2020-12-01 270 6000 sold NULL 2 6
7 17000 2020-09-19 850 6000 sold 12 2 7
8 13000 2020-11-16 520 6000 sold NULL 1 8
9 NULL 2020-11-21 0 NULL visit NULL 1 4
10 NULL 2020-11-02 0 NULL visit NULL 1 4
13 12000 2020-02-16 480 6000 sold NULL 3 2
14 10000 2020-03-12 300 6000 sold 2 4 2

Write the SQL statements necessary to satisfy the following queries. Remember to use sensible
headings where appropriate:

1. Produce a list of customers in customer number order. (2)


2. Produce a list of sales staff ordered by centre number then salesperson number. (This should be
one query only) (2)
3. Produce output which lists of the total cost of the cars sold by each salesman. (3)
4. Produce a list of customers that do not currently have any car sales in the carsale table. (3)
5. Find the commission of “Anglena”, display the name, commission and sale date. (3)
6. Center number three employees a new sale person “Mike”. He lives in North west America, New
York, street 2. His cell number is (555) 555-6655. Make a query to insert data in database. (2)
7. select salepersonNo,count(SaleType) as NoOfCarsSold from carsales
where(saleDate between "2020/6/12" AND "2020/12/12") group by salepersonNo;
Display the output of Query. (3)
Write the Relational Algebra Queries statements to satisfy the following queries.

1. Find all the tuples from sale person table from center number 4. (1)
2. Find all the tuples from carsales table where commission is 0. (1)
3. Find the name, phone number and address of salesperson from center 2. (2)
4. Find the center name and location of sale person “Sara”. (2)
5. Find all the customer from “LA”. (1)

Good Luck 

Das könnte Ihnen auch gefallen