Q2smallWhat is the difference between a super key and a candidate key?
A super key is any attribute set that uniquely identifies a tuple (it may have extra attributes). A candidate key is a minimal super key — no attribute can be removed. Every candidate key is a super key, but not vice-versa.
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.
Candidate keys: {ID} and {u_name} (each minimal & unique). Primary key: either {ID} or {u_name} — one chosen candidate key.
Q4bigWrite a relational-algebra expression: names of all INSTRUCTORs in 'Comp. Sci.' earning more than 70000.
Apply σ first (filter rows), then π (keep the name column). For our data that yields: { Katz } (Katz, Comp. Sci., 75000).
ID
name
dept_name
salary
22222
Einstein
Physics
95000
12121
Wu
Finance
90000
32343
El Said
History
60000
45565
Katz
Comp. Sci.
75000
98345
Kim
Elec. Eng.
80000
76766
Crick
Biology
72000
6 tuples · 4 attributes
Q5bigWhen is a UNION r ∪ s valid, and what happens to duplicates?
Valid only when r and s are union-compatible: same number of attributes with compatible domains. Duplicate tuples are automatically eliminated (a relation is a set).
A
B
α
1
α
2
β
1
3 tuples · 2 attributes
A
B
α
2
β
3
2 tuples · 2 attributes
Q6bigWhich join keeps courses that have NO faculty assigned, and how are missing values shown?
A left outer join (Course ⟕ CourseFaculty) keeps every left-relation tuple; unmatched right-side attributes become NULL. That surfaces courses with no faculty.
Q7smallEqui-join vs theta join — what's the relationship?
A theta join uses any comparison operator. An equi-join is the special case where the condition is only equality. Natural join is an equi-join on all same-named attributes (with duplicate columns removed).