Practice & Simulations

Try each question before revealing. Then step through the natural-join simulation to see how the operators compose.

Sample questions

Q1smallName the three relational-model synonyms: a table, a row, and a column are also called…?
Q2smallWhat is the difference between a super key and a candidate key?
Q3smallGiven R = {ID, u_name, name, dept_name, salary} where both ID and u_name are unique, list the candidate keys and a valid primary key.
Q4bigWrite a relational-algebra expression: names of all INSTRUCTORs in 'Comp. Sci.' earning more than 70000.
Q5bigWhen is a UNION r ∪ s valid, and what happens to duplicates?
Q6bigWhich join keeps courses that have NO faculty assigned, and how are missing values shown?
Q7smallEqui-join vs theta join — what's the relationship?

Simulation — build a Natural Join step by step

1 · Inputs r and s

Common attributes: B and D.

ABCD
α1αa
β2γa
γ4βb
α1γa
δ2βb
5 tuples · 4 attributes
BDE
1aα
3aβ
1aγ
2bδ
3bε
5 tuples · 3 attributes

Open RA Playground →   Open SQL Playground →