# Data Base Management System | Week 3

Course Name: Data Base Management System

#### Q1. Consider the following instance of the relation MovieBooking (MovieName, TheatrID, HallNo, Glasses 3D, MLanguage, Showtime ID, ShowDay)

Which of the following MovieNames are produced by the Relational Algebra expression given below?
IlMovieName (HallNo>2^MLanguage English’ (MovieBooking))
IlMovie Name (Glasses3D-‘Yes’ (MovieBooking))

a) The Martian
b) Interstellar
c) Gravity
d) Inception

These are Data Base Management System Week 3 Assignment Answers

Q2. Consider the relation Employee (EID, Dept, Experience, Salary). What is the Tuple Relational Calculus expression equivalent to the statement “Select those Employee IDs (EID) whose Experiences are more than 10 years “?
a) {13 p,t Employee (t [Salary] =p [Dept] v p [Experience] =10)}
b) {t13p = Employee (t [EID] =p [EID] ^ p [Experience] >10)}
c) {t13 p,t Employee (t [Salary] =p [EID] ^ p [EID]>10)}
d) {13p = Employee (t [EID] =p [EID] ^ p [Employee] >10)}

Answer: b) {t13p = Employee (t [EID] =p [EID] ^ p [Experience] >10)}

These are Data Base Management System Week 3 Assignment Answers

Q3. Consider the following Entity Relationship Diagram :

If n [Payment] is the number of attributes present in the relational schema of Payment, n[In_Cash] is the number of attributes present in the relational schema of In-Cash and n[In Cheque] is the number of attributes present in the relational schema of In_Cheque, which of the following options can NOT be true?
a) n[Payment] = 6
b) n[In Cheque] = 6
c) n[In_Cash] = 4
d) n[In_Cheque] = 3

These are Data Base Management System Week 3 Assignment Answers

Q4. Consider the Entity Relationship diagram:

Which attribute will not be present in the schema of ManagedBy?
a) cnumber
b) id
c) experience
d) Enrolment

These are Data Base Management System Week 3 Assignment Answers

Q5. In a company, the Building relation maintains information about the BuildingLocation, BuildingFloors, BuildingType and BuildingColor. What will be the Domain Relational Calculus expression to obtain the Building Locations of those Buildings whose BuildingColor is “Gray”?
a) {plan,t,c ( € Building ^c=”Gray”)}
b) {plan,t,c (n,t,c € Building ^c=”Gray”) }
c) {n,t,c (p,n,t,c € Building V c=”Gray”)}
d) {ln,t,c ( € Building ^ c=”Gray”)}

Answer: d) {ln,t,c ( € Building ^ c=”Gray”)}

Q6. Consider the Entity Relationship diagram : Which of the following statement (s) is/are TRUE?

a) DOGS inherit the attributes of CARNIVORES but not of ANIMALS.
b) DOGS inherit the attributes of CARNIVORES and ANIMALS.
c) CARNIVORES inherit the attributes of DOGS but not of OMNIVORES.
d) ANIMALS inherit the attributes of CARNIVORES, OMNIVORES, HERBIVORES and DOGS.

Answer: c) CARNIVORES inherit the attributes of DOGS but not of OMNIVORES.

These are Data Base Management System Week 3 Assignment Answers

Q7. In a company, a Handicraft is made by multiple Artisans and an Artisan makes multiple Handicrafts. The Handicrafts are identified by their unique Tags. A Handicraft is made of a particular Material and is multi- Colored. An Artisan has a unique ID. Assuming there is a Creates relation between Handicraft and Artisan, what will be the correct schema for Creates and Handicraft?
a) Creates (Tag, ID)
Handicraft (Tag, Material, Color)
b) Creates (ID)
Handicraft (Tag Material)
Handicraft_color (Tag, Color)
c) Creates (Tag, ID, Color)
Handicraft (Tag, Material)
d) Creates (Tag, ID)
Handicraft (Tag, Material)
Handicraft_color (Tag, Color)

Handicraft (Tag, Material)
Handicraft_color (Tag, Color)

These are Data Base Management System Week 3 Assignment Answers

Q8. Consider 2 instances:

Which PageNumber is not produced by the following Relational Algebra?
((IIpageNumber, Topic (Chapter) – Paragraph) x Paragraph) IIchapter.PageNumber
a) 11
b) 40
c) 20
d) 33

These are Data Base Management System Week 3 Assignment Answers

Q9. Consider the relation GROCERY (ITEM, PRICE, MONTH). Select the SQL query from within a host language, to find those ITEMS whose PRICE has exceeded the price stored in monthly budget in a specific MONTH defined in target_month. monthly budget and target-month are declared in host language.

a) EXEC SQL
DECLARE C CURSOR FOR
SELECT ITEM
FROM GROCERY
WHERE PRICE > monthly_budget AND MONTH= target_month
END_EXEC
b) EXEC SQL
DECLARE C CURSOR FOR
SELECT GROCERY
FROM GROCERY
WHERE PRICE > monthly_budget AND MONTH= : target_month
END_EXEC
c) EXEC SQL
DECLARE C CURSOR FOR
SELECT ITEM
FROM GROCERY
WHERE PRICE >: monthly_budget
END_EXEC
d) EXEC SQL
DECLARE C CURSOR
FOR SELECT ITEM
FROM PRODUCT
WHERE PRICE >: monthly_budget AND MONTH= : target_month
END EXEC

DECLARE C CURSOR
FOR SELECT ITEM
FROM PRODUCT
WHERE PRICE >: monthly_budget AND MONTH= : target_month
END EXEC

These are Data Base Management System Week 3 Assignment Answers

Q10. Consider the following instance of a relation Uniform :

How many tuples will be returned by the following Relational Algebra Query? Uniform) ÷ Ilcolor (Color=’Blue Uniform)) U ((School=’KidSys’vColor=’Blue IISchool (Color White/Uniform)
a) 1
b) 2
c) 3
d) 4

These are Data Base Management System Week 3 Assignment Answers

These are Data Base Management System Week 3 Assignment Answers