Font size
WorksheetsSpring2026.DBI202.Chapter2.Quiz
Total questions: 27
Worksheet time: 20mins
The operation that produces a new relation with a subset of columns from the original relation is called (a) .
πA=10(R)
σA=10(R)
ρR(A=10)
R⋈A=10
To combine all tuples from two union-compatible relations, we use the (a) operator.
The (a) operator, denoted by ⋈, combines tuples from two relations that match on all common attributes.
All options are correct
In the expression πname,age(σage>20(Students)), which operation is performed first?
A Theta-join (R⋈θS) is equivalent to a ________ followed by a Selection.
All options are correct
To find the intersection of R and S (R∩S) using only Difference (−), the formula is ________.
R - (S - R)
S - (R - S)
π
The result of πL(R) has a degree equal to the number of attributes in ________.
R
π
Relations used: Inventory (partID, partName, color), Suppliers (sid, sName, address)
and Catalog (sid, partID, cost).
Find all rows in the Inventory relation with a color attribute of 'Red'.
σcolor=′Red′(Inventory)
πcolor=′Red′(Inventory)
ρcolor=′Red′(Inventory)
∪color=′Red′(Inventory)
Relations used:
Inventory (partID, partName, color)
Suppliers (sid, sName, address)
Catalog (sid, partID, cost)
Find the IDs of suppliers (sid) who supply part 'P101'. Answer: πsid(σpartID=′P101′( (a) ))
{B}
{A, R.B, S.B, C}
{A, C}
To find the intersection of R and S using only the Difference operator, the formula is: R−(R−?).
(a)
Relations used:
Inventory (partID, partName, color)
Suppliers (sid, sName, address)
Catalog (sid, partID, cost)
Find the names of suppliers (sName) who supply 'Red' parts with a cost < 50. Answer:
πsName(Suppliers⋈(σcolor=′Red′ AND cost<50(Inventory⋈ (a) )))
Given:
Inventory (partID, partName, color)
Suppliers (sid, sName, address)
Catalog (sid, partID, cost)
Find partIDs (partID) supplied by both 'Supplier A' AND 'Supplier B'.
πpartID(σsName=′SupplierA′(S⋈C)) ∩ πpartID(σsName=′SupplierB′(S⋈C))
πpartID(σsName=′SupplierA′(S⋈C)) ∪ πpartID(σsName=′SupplierB′(S⋈C))
πpartID(σsName=′SupplierA′ AND sName=′SupplierB′(S⋈C))
πpartIDσsName=′SupplierA′ AND sName=′SupplierB′(S⋈C)
Given:
Inventory (partID, partName, color)
Suppliers (sid, sName, address)
Catalog (sid, partID, cost)
Find the names of parts (partName) that are NOT in the Catalog.
Answer: πpartName(Inventory)−πpartName(Inventory⋈?)
(a)
Relations used:
Inventory (partID, partName, color)
Suppliers (sid, sName, address)
Catalog (sid, partID, cost)
Find the addresses of suppliers in 'Hanoi' who supply 'Blue' or 'Green' parts.
Answer: π (a) (σaddress=′Hanoi′(Suppliers)⋈Catalog⋈σcolor='Blue' OR color='Green'(Inventory))
Relations used:
Inventory (partID, partName, color)
Suppliers (sid, sName, address)
Catalog (sid, partID, cost)
Find the IDs of parts supplied by at least two different suppliers.
πC1.partID(σC1.partID=C2.partID AND C1.sid≠C2.sid(ρC1(Catalog)×ρC2(Catalog)))
πC1.partID(σC1.partID=C2.partID AND C1.sid≠C2.sid(ρC1(Catalog)⋈ρC2(Catalog)))
πC1.partID(σC1.partID=C2.partID OR C1.sid≠C2.sid(ρC1(Catalog)×ρC2(Catalog)))
πC1.partID(σC1.partID≠C2.partID AND C1.sid≠C2.sid(ρC1(Catalog)×ρC2(Catalog)))
Relations used:
Inventory (partID, partName, color)
Suppliers (sid, sName, address)
Catalog (sid, partID, cost)
Find the partID of parts that have the color 'Red' OR have a cost < 10.
πpartID(σcolor=′Red′(Inventory))∪πpartID(σcost<10(Catalog))
πpartID(σcolor=′Red′(Inventory))⋂πpartID(σcost<10(Catalog))
πpartID(σcolor=′Red′(Inventory))⋂(σcost<10(Catalog))
πpartID(σcolor=′Red′(Inventory))∪(σcost<10(Catalog))
