0% found this document useful (0 votes)
11 views

Assignment_3_NPTEL_DBMS_January_2025

The document contains an assignment for a Database Management System course with multiple-choice questions (MCQs) covering topics such as relational algebra, entity-relationship diagrams, and SQL queries. Each question includes a scenario, answer options, and explanations for the correct answers. The assignment consists of 10 questions, each worth 2 marks, totaling 20 marks.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Assignment_3_NPTEL_DBMS_January_2025

The document contains an assignment for a Database Management System course with multiple-choice questions (MCQs) covering topics such as relational algebra, entity-relationship diagrams, and SQL queries. Each question includes a scenario, answer options, and explanations for the correct answers. The assignment consists of 10 questions, each worth 2 marks, totaling 20 marks.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Course Name: Database Management System

Assignment 3 - Week 3 (Jan 2025)


TYPE OF QUESTION: MCQ/MSQ

Number of questions: 10 Total mark: 10 X 2 = 20

Question 1
An organization, collecting car renters’ information, considers the following relations:
Renter(Renter ID, Contact)
Renting(Renter ID, Car Number)
Car(Car Number, Model).
What will the following relational algebra expression return to the organization?

ΠContact (Renter) − ΠContact (Renter 1 Renting)

a) The Contacts of those Renters who are Renting at most one Car at that instance.

b) The Contacts of those Renters who are Renting every Car at that instance.

c) The Contacts of those Renters who are Renting at least one Car at that instance.

d) The Contacts of those Renters who are not Renting any Car at that instance.

Answer: d)
Explanation: ΠContact (Renter) returns all the Contacts from the enlisted Renters.
ΠContact (Renter 1 Renting) returns the Contacts of those Renters whose IDs have matched with
some ID in Renting i.e. the Contacts of those Renters who are Renting some Car at that instance.
Therefore, the (Contacts of all Renters − the Contacts of those Renters renting some Car) gives
the Contacts of those Renters who are not Renting any Car.
Hence, option d) is correct.

1
Question 2
An institute, maintaining a biological information system, designs an entity Species having the at-
tributes ID, Name, and Tags. ID is unique and cannot be NULL. The Name is composed of Generic
and Specific names. Tags can have multiple values. Which of the following ER notation represents
the entity Species correctly?

a)

b)

c)

d)

Answer: b)
Explanation: From the given problem, the ID should be the key attribute, denoted by underline,
Name should be a composite attribute where the sub-atrributes Generic, Specific should be denoted
with an indentation and Tags is a multivalued attribute enclosed by {}.
Hence, option b) is correct.

2
Question 3
Consider 2 instances:

Chapter
PageNo Topic Length
Paragraph
1 Introduction 5
PageNo Topic
2 SQL 6
2 SQL
3 RA 7
3 RA
4 FD 8
3 ERD 2
Which of the following operations return the 2 tuples that are present in Paragraph?

a) (Chapter)-(ΠPageNo,Topic (Chapter)-Paragraph)

b) (Chapter × Paragraph) ∩ (Paragraph × Chapter)

c) (Paragraph) ∩ (ΠPageNo,Topic (Chapter) ∪ Paragraph)

d) ΠPageNo,Topic ((ΠPageNo,Topic (Chapter)-Paragraph) × Paragraph)

Answer: c)
Explanation: Option (a) results in invalid − operation as the “arity” of Chapter and
(ΠPageNo,Topic (Chapter)-Paragraph) are not same.
Option (b) is incorrect as the ∩ operation has relations with incompatible domains of attributes on
L.H.S and R.H.S.
Option (c) is correct. As Paragraph ⊂ Chapter, ΠPageNo,Topic (Chapter) ∪ Paragraph results in
all the values of PageNo, Topic in Chapter and the ∩ selects the ones in Paragraph only.
Option (d) is incorrect as the outermost projection operation results in ambiguity.

3
Question 4
Consider the relations Temp India(Place, Celsius) and Temp France(Place, Celsius) and the
following instances:

Temp India
Temp France
Place Celsius
Place Celsius
Ahmedabad 29
Nice 20
Jaipur 22
Paris 18
Roorkee 22
Dijon 11
Kolkata 21

X = Temp India-((Temp India ∪ Temp France)-(Temp India - Temp France))


Which of the following is X?

a) Temp India

b) Temp France

c) Temp India ∪ Temp France

d) Temp India ∩ Temp France

Answer: a)
Explanation: ((Temp India ∪ Temp France)) produces all tuples from both relations.
(Temp India - Temp France) = Temp India.
Thus, ((Temp India ∪ Temp France)-(Temp India - Temp France)) = Temp France
and Temp India-((Temp India ∪ Temp France)-(Temp India - Temp France)) = Temp India.
Hence, option (a) is correct.

4
Question 5
Consider the relational schema Photography(Photographer, Camera, Theme, Location).
Choose the correct Tuple Relational Calculus that represents the following statement
“Display all photographers who clicked photographs with a DSLR camera in Darjeeling.”

a) {p, t|p,t ∈ (t[Photographer]=p[Photographer] ∧ p[Camera]=‘DSLR’


∧p[Location]=‘Darjeeling’)}

b) {t|p < p[Camera]=‘DSLR’∧p[Location]=‘Darjeeling’)>}

c) {p, t|∃p ∈ Photography (p[Camera]=‘DSLR’∧p[Location]=‘Darjeeling’)}

d) {t|∃p ∈ Photography (t[Photographer]=p[Photographer] ∧ p[Camera]=‘DSLR’


∧p[Location]=‘Darjeeling’)}

Answer: d)
Explanation: The tuple to be selected is represented by ‘t’ and the selection conditions are written
with ∧ as per the given question. According to the projection and selection operations shown in
lecture slides 12.26 - 12.28, option (d) shows the correct syntax and semantics of the Tuple Relational
Calculus.

5
Question 6
Consider the following instance of the relation CakeShop(Owner, Name):

CakeShop
Owner Name
Peter BakeCake
Viola CakeStop
John Cherry
Peter SweetTooth
Peter FudgePalace
Viola Desserted

Which of the following relational algebra expression does generate names of those Owners who owns
two or more CakeShops?

a) ΠC1.Owner (σC1.Owner̸=C2.Owner∧C1.Name̸=C2.Name (ρC1 (CakeShop) × ρC2 (CakeShop)))

b) ΠC1.Owner (σC1.Owner=C2.Owner∧C1.Name̸=C2.Name (ρC1 (CakeShop) × ρC2 (CakeShop)))

c) ΠC1.Owner (σC1.Owner=C2.Owner∧C1.Name=C2.Name (ρC1 (CakeShop) × ρC2 (CakeShop)))

d) ΠC1.Owner (σC1.Owner̸=C2.Owner∧C1.Name=C2.Name (ρC1 (CakeShop) × ρC2 (CakeShop)))

Answer: b)
Explanation: The Cartesian product between the renamed tables will generate 36 tuples and the
condition σC1.Owner=C2.Owner∧C1.N ame̸=C2.N ame selects the following tuples out of the 36 tuples:

C1.Owner C1.Name C2.Owner C2.Name


Peter BakeCake Peter SweetTooth
Peter BakeCake Peter FudgePalace
Viola CakeStop Viola Desserted
Peter SweetTooth Peter BakeCake
Peter SweetTooth Peter FudgePalace
Peter FudgePalace Peter BakeCake
Peter FudgePalace Peter SweetTooth
Viola Desserted Viola CakeStop

The final projection of C1.Owner will only produce {Peter, Viola}.


Hence, option (b) is correct.

6
Question 7
Consider the relational schema FormulaBook(Page, Sl, Formula).
An embedded SQL query is written with C as host language to derive some Formula entered in the
FormulaBook according to the following conditions
EXEC SQL
DECLARE c CURSOR FOR
SELECT Formula
FROM FormulaBook
WHERE Page> :PageGiven AND Sl=:SLGiven
END EXEC
Select the correct option for declaring the variables PageGiven and SLGiven.

a) EXEC-SQL BEGIN
int :PageGiven ;
int :SLGiven ;
EXEC-SQL END;

b) EXEC-SQL BEGIN DECLARE SECTION


int PageGiven ;
int SLGiven ;
EXEC-SQL END DECLARE SECTION;

c) EXEC-SQL BEGIN DECLARE SECTION


int :PageGiven ;
int :SLGiven ;
EXEC-SQL END DECLARE SECTION;

d) EXEC-SQL BEGIN
int PageGiven ;
int SLGiven ;
EXEC-SQL END;

Answer: b)
Explanation: The declaration of the variables are enclosed within
EXEC-SQL BEGIN DECLARE SECTION
EXEC-SQL END DECLARE SECTION;
The variable declaration follow the host language syntax. Hence, option (b) is correct.

7
Question 8
In a printing company, a Book is printed by multiple Employees and an Employee prints multiple
Books. The Books are identified by their unique Title. A Book also has an Edition and multiple
values of the attribute Author. An Employee has a unique ID. Assuming there is a Prints relation
between Book and Employee, what will be the correct schema for Prints and Book?

a) Prints(Title, ID)
Book(Title, Edition, Author)

b) Prints(ID)
Book(Title Edition)
Book author(Title, Author)

c) Prints(Title, ID)
Book(Title, Edition)
Book author(Title, Author)

d) Prints(Title, ID, Author)


Book(Title, Edition)

Answer: c)
Explanation: The following represents the ER diagram of the given case.

In many-to-many relation, the relation Prints should have the primary keys of the participating
entities and since Author is multivalued, a separate schema has to be created named Book author.
Hence, option (c) is correct.

8
Question 9
Consider the Entity Relationship Diagram:

Which of the following is an alternate ER notation for Owner?

a)

b)

c)

d)

Answer: a)
Explanation: As per the alternate ER notation shown in lecture slide 15.27.

9
Question 10
Consider the Entity Relationship Diagram:

Which of the following is/are not true?

a) NewCar and OldCar are Overlapping specializations of Car.

b) Participation of Car in Owns is total.

c) Age is a composite attribute of Owner.

d) DOB is a component attribute of Address.

Answer: c), d)
Explanation: Option (a) and (b) are true as per the ER Diagram notations. Age is a derived attribute
of Owner. DOB is not a component attribute of Address. Hence, options (c) and (d) are not true.

10

You might also like