Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

DBMS Cie 2

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

U.S.N.

BMS COLLEGE OF ENGINEERING, BENGALURr- 19


(Autonomous Institute, Affiliated to VTU)
DEPARTMENT OF MACHINE LEARNING

Continuous Internal Evaluation (CIE) -2

Course Code
20AM4PCDBM Course Title:|Databasemanagement systems
Maximum Marks 40 Date : 24-08-2022
Semesteer 4
:
Faculty FHandling the Course :SBS
Instructions: Internal Choice is provided in
Part -

art Part A
Total 5 Marks (No Choice)
Q. No. Question Marks Co | Level
la What is union compatibility? Why do the UNION, INTERSECTION, and 5M
DIFFERENCE operations require that the relations on which they are
applied be union compatible?
Part B
Total 15 Marks (No Choice)

Q.No. Question Marks CO Level


2a Consider the following schema: SM 1,2 2

Suppliers (sid:integer, sname : string, address: string)


Parts (pid:integer, pname : string, color: string)
Catalog (sid:integer, pid:integer, cost : real)
The key fields are underlined, and domain ofeach field is listed after the
field name. Write the relational algebra queries for following:
i. Find the name of the suppliers whose id -21.
ii. Find the name of suppliers who supply some red parts
ii. Find the sids of suppliers who supply some red or green parts
iv. Find the sids of suppliers who supply every part
v. Find sid and pid for which cost >2000.

Discuss four informal guidelines that may be used as measures to SM


2
determine the quality of relation schema design
2c Consider the following six relations for an order-processing database SM
appli- cation in a company:
CUSTOMER(Cust#, Cname, City) ORDER(Order, Odate, Cust#,
Ord amt) ORDER_ITEM(Ordert, Itemt, Qty)
ITEM(Item#, Unit_price)

Page 1 of 3
U.S.N.

SHIPMENT(Order#, Warehouse#, Ship_ date)


WAREHOUSE(Warehousc#, City)
Here, Ord amt refers to total dollar amount of an order; Odate is the date
the order was placed: and Ship_ date is the date an order (or part ot an
order) is shipped from the warehouse. Assume that an order can be
shipped from sev- eral warehouses. Specify the foreign keys for this
schema, stating any assumptions you make. What other constraints can
you think of for this database?

Part C
Total 20 Marks (Internal Choice)
Q. No. Question
Marks CO Level
3a User 3
10M
1d Name Age Gender Occupationid Cityld
John 25 Male 3

Sara 20 Female

Victor 31 Male

Jane 27 Female

Occupation City
Occupationid OccupationName Cityld CityName

Software Engineer Halifax

Accountant Calgary

Phamacst Boston

Library Assistant New York

Toronto

1. Solve the following relational expressions for above relations.


a. PNarne(Rage-2s(User))
b. RrravAge-3:(User)
Occupatonia(User X Occupation)
user Occupationld-Oocupation
d. User Occupation « City

e. PName.Gendecname-Boston(ser City))

2. Write SQL statements for relational expressions in question 1.


OR
Figure 6.15. Show the 10M
Consider the two tables Tl and T2 shown in
3b
results of the following operations:

Page 2 of 3
a. Tl 4
TIP =T2.A T2
b. Tl T1.Q= T2.B 2
T1 T2
C.
TLP =T2.A
d. TI a T2
TI.Q= T2.B
e. Tlu T2
f. Tl T2
4
(T1.P =T2.A AND T1R =
T2.C)
TABLE T1 TABLE T2

PaR ABC
10 a 10 b
15 8 25 c 3

25 a 6 10 b 5

Consider the following relations for a database that keeps track of automobile 10M
4a
sales in a car dealership (OPTION refers to some optional equipment installed on
an automobile):

CAR(Serial_no, Model, Manufacturer, Price)

OPTION(Serial_no, Option_name, Price)

SALE(Salesperson_id, Serial_no, Date, Sale_price)

SALESPERSON(Salesperson_id, Name, Phone)

First, specify the foreign keys for this schema, stating any assumptions you
make. Next, populate the relations with a few sample tuples, and then give an
of an insertion in the SALE and SALESPERSON relations that violates the
example
referential integrity constraints and of another insertion that does not.
OR

4b Give the Relation Employee and Department. 10M 3

Employee Department Department Head


Ram Production Production Brown
Raju Sales
Ramu |Production Purchasing Blak
Find the following and justify your answer.
i. Cartesian Product ii. Equi join ii. Full Outer Join

iv. Left Outer Join v. Right Outer Join

Page 3 of 3

You might also like