You are on page 1of 5

Assignment submitted on 2023-02-13,

19:02 IST
Which of the following statements about the relational model
is/are incorrect ?

A key cannot be determined from any particular instance data.


Some relations may not have a foreign key.
Some relations may not have a key.
A key of a relation may have more than one attribute.

Yes, the answer is correct.


Score: 1
Accepted Answers:
Some relations may not have a key.

Consider the following statements about relational model and find TRUE ones:

The join relational algebra operator can NOT be expressed using other
operators.
The cross product relational algebra operator requires its operands to be
union-compatible.
The difference relational algebra operator requires its operands to be
union-compatible.
When project is applied on an instance r, the size of the result will
always be the same as that of r.

No, the answer is incorrect.


Score: 0
Accepted Answers:
The difference relational algebra operator requires its operands to be union-
compatible.

Suppose A is a foreign key in a relation R that refers to tuples of relation S


using values of the key attribute B of S. Let X be the set of all non-null values
of column A and let Y be the set of all values of column B. Identify the correct
relationship between X and Y that holds on all instances of R and S:

X is a subset of Y
X is a proper subset of Y
Y is a subset of X
X need not be a subset of Y and Y need not be a subset of X

Yes, the answer is correct.


Score: 1
Accepted Answers:
X is a subset of Y

The join operation on two relations can be equivalently realised by doing

A cartesian product of the two relations followed by a selection


A cartesian product of the two relations
A union of the two relations followed by a selection
A union of two relations

Yes, the answer is correct.


Score: 1
Accepted Answers:
A cartesian product of the two relations followed by a selection

Consider the following relations S1( A, B, C, D ) and S2( E, F, G, H ) and the


given instances. What is the result of the relational algebra expression :

ΠA,B ( σ(C = 3)⋁(D = 1) (S1) ) − ΠE,F ( σ(G ≠ 2)⋁( H ≠ 3) (S2) )

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
Using the relations in Question 5. Find out how many tuples will be there in
the result of the following relational algebra expression.

S1⋈(S1.B>S2.H)S2

2
7
8
10

Yes, the answer is correct.


Score: 1
Accepted Answers:
8

1 point
Consider the following three relations in a relational database.
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))
Partially Correct.
Score: 0.5
Accepted Answers:
Π{eId} ( (Own) / Π{bId}(Brand) )
Π{eId} (Own) – Π{eId}( (Π{eId}(Own) ✕ Π{bId}(Brand)) – Own )

1 point
Given the relations
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.

Yes, the answer is correct.


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

1 point
The following relation records the age of 500 employees of a company
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

Yes, the answer is correct.


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

1 point
Consider the join of a relation R with a relation S. If R has m tuples and S
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
Yes, the answer is correct.
Score: 1
Accepted Answers:
mn and 0

You might also like