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

X

(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)

arunkumaran0705@gmail.com 

NPTEL (https://swayam.gov.in/explorer?ncCode=NPTEL) » Introduction to Database

Systems (course)

Course
outline Week 3: Assignment 3
The due date for submitting this assignment has passed.
Introduction Due on 2023-02-15, 23:59 IST.
to As per our records you have not submitted this assignment.
Database
Systems () 1) Which of the following statements about the relational model is/are 1 point
incorrect ?
Week 0 ()
A key can not be determined from any particular instance data.

Week 1 () Some relations may not have a foreign key.


Some relations may not have a key.
Week 2 () A key of a relation may have more than one attribute.

No, the answer is incorrect.


Week 3 () Score: 0
Accepted Answers:
Relational
Some relations may not have a key.
Data Model
and Notion
of Keys 2) Consider the following statements about relational model and find TRUE 1 point
(unit? ones:
unit=31&lesson=32)
The join relational algebra operator can NOT be expressed using other
Introduction operators.
to
The cross product relational algebra operator requires its operands to be
Relational
Algebra union-compatible.
(unit? The difference relational algebra operator requires its operands to be union-
unit=31&lesson=33) compatible.
Operators in When project is applied on an instance r, the size of the result will always be
Relational the same as that of r.
Model (unit?
unit=31&lesson=34)
No, the answer is incorrect.
Score: 0
Uses of Accepted Answers:
Renaming, The difference relational algebra operator requires its operands to be union-
Join and compatible.
Division in
Relation 3) Suppose A is a foreign key in a relation R that refers to tuples of relation 1 point
Algebra S using values of the key attribute B of S. Let X be the set of all non-null values of
(unit? column A and let Y be the set of all values of column B. Identify the correct
unit=31&lesson=35) relationship between X and Y that holds on all instances of R and S:

Lecture
X is a subset of Y
Slides (unit?
unit=31&lesson=36) X is a proper subset of Y
Y is a subset of X
Practice:
Week 3: X need not be a subset of Y and Y need not be a subset of X
Assignment No, the answer is incorrect.
3 (Non Score: 0
Graded) Accepted Answers:
(assessment? X is a subset of Y
name=115)

Quiz: Week 4) The join operation on two relations can be equivalently realised by doing 1 point
3:
Assignment A cartesian product of the two relations followed by a selection
3 A cartesian product of the two relations
(assessment?
A union of the two relations followed by a selection
name=128)
A union of two relations
Week 3
Feedback
No, the answer is incorrect.
Score: 0
form :
Accepted Answers:
Introduction
A cartesian product of the two relations followed by a selection
to Database
Systems
(unit? 5) Consider the following relations S1( A, B, C, D ) and S2( E, F, G, H ) and 1 point
unit=31&lesson=38) the given instances. What is the result of the relational algebra expression :

Week 4 ()

Week 5 ()

Week 6 ()

Week 7 ()

Week 8 ()

Week 9 ()
Week 10 ()

Week 11 ()

Week 12 ()

Download
Videos ()

Lecture
Notes ()

Live
Sessions
()

Problem
ΠA,B ( σ(C = 3)⋁(D = 1) (S1) ) − ΠE,F ( σ(G ≠ 2)⋁( H ≠ 3)
Solving
(S2) )
Session ()
Empty relation
 
{ (1,2), (3,6) }
A relation with scheme (A,B) and tuples { (1,2) }
A relation with scheme (A,B) and tuples { (1,2), (2,5), (3,6) }

No, the answer is incorrect.


Score: 0
Accepted Answers:
Empty relation

6) Using the relations in Question 5. Find out how many tuples will be there 1 point
in the result of the following relational algebra expression.
S1 ⋈ (S1.B>S2.H ) S2

2
7
8
10

No, the answer is incorrect.


Score: 0
Accepted Answers:
8

7) Consider the following three relations in a relational database. 1 point


Employee(eId, Name), Brand(bId, bName), Own(eId, bId)

Which of the following relational algebra expressions return the set of eids of
employees who own all the brands?
Π{eId} ( (Own) / Π{bId}(Brand) )
Π{eId} (Own) – Π{eId}( (Π{eId}(Own) ✕ Π{bId}(Brand)) – Own )
Π{eId} ( (Own) / Π{bId}(Own) )
Π{eId} ( (Π{eId}(Own) ✕ Π{bId}(Own) ) / Π{bId}(Brand))

No, the answer is incorrect.


Score: 0
Accepted Answers:
Π{eId} ( (Own) / Π{bId}(Brand) )
Π{eId} (Own) – Π{eId}( (Π{eId}(Own) ✕ Π{bId}(Brand)) – Own )

8) Given the relations 1 point


Employee( eid, name, salary, dept-no)
Department( dept-no, dept-name, address)

Which of the following queries cannot be expressed using the basic relational algebra
operations ( σ, Π, ✕, ⋈, ⋃, ⋂, 一 ) ?

Department address of every employee


Employees whose name is the same as their department name.
The sum of the salary values of all employees.
All employees of a given department.

No, the answer is incorrect.


Score: 0
Accepted Answers:
The sum of the salary values of all employees.

9) The following relation records the age of 500 employees of a company 1 point
empAge(empNo, age)

Consider the following relational algebra expression:


ΠempNo( empAge ⋈ (age > age1)ρempNo1,age1(empAge))
What does the above expression generate?

Employee numbers of only those employees whose age is the maximum.


Employee numbers of only those employees whose age is more than the age
of exactly one other employee.
Employee numbers of all employees whose age is not the minimum.
Employee numbers of all employees whose age is the minimum

No, the answer is incorrect.


Score: 0
Accepted Answers:
Employee numbers of all employees whose age is not the minimum.

10) Consider the join of a relation R with a relation S. If R has m tuples and S 1 point
has n tuples then the maximum and minimum sizes of the result of a join, respectively,
are:
m + n and 0

mn and 0

m + n and |m − n|

mn and m + n

No, the answer is incorrect.


Score: 0
Accepted Answers:
mn and 0

You might also like