Students has name and age attributes. In π_name(σ_age>10(Students)), which operation acts first?
- Project names first, then test the removed age attribute
- Run both operations together without an intermediate relation
- Select by age, then project names
R has attributes id, name and course. What is the result schema of π_id,course(R)?
- id, name and course
- id and course
- name and course only
- id and name only
R(a,b) = {(1,4),(2,5)}. Which display contains exactly the same relation?
- S(a,b) = {(4,1),(5,2)}
- S(a,b) = {(1,4),(2,6)}
- S(a,b) = {(2,5),(1,4)}
- S(a,b) = {(1,4),(2,5),(3,6)}
Which sentence describes a relation in the mathematical relational model?
- A set of tuples over named attributes
- A list of values whose row positions define identity
- A collection of rows with no fixed set of attributes
Compatible relations R and S share 2 of R's 4 tuples. How many tuples are in R - S?
Answer: ______________
Students(id,name,age) and Enrolled(id,course) share only id. Which expression returns name/course pairs for enrolled students over 21? Here ⋈ is natural join.
- π_name,course(σ_age>21(Students) ⋈ Enrolled)
- π_name,course(Students ⋈ Enrolled), retaining students of every age
- π_name,course(π_name(Students) ⋈ Enrolled), removing the matching id
- π_name,course(Students ∪ Enrolled), pooling the different schemas
Compatible relations R and S contain 6 and 5 tuples. Exactly 3 tuples occur in both. How many tuples are in R ∪ S?
Answer: ______________
R(id,name) = {(10,Uma),(11,Uma),(12,Sol)}. How many tuples are in π_name(R) under pure relational algebra?
- 2 tuples
- 3 tuples
- 1 tuple
- 0 tuples
Students(id,age) and Enrolled(id,course) share only id. Which expression always equals σ_age>21(Students ⋈ Enrolled)?
- Students ⋈ σ_age>21(Enrolled), testing age in the enrollment input
- π_id(σ_age>21(Students)) ⋈ Enrolled, removing age from the result
- σ_age>21(Students) ⋈ Enrolled
- σ_age>21(Students) ∪ Enrolled, replacing matching pairs with union
R(a,b) = {(2,7)} and S(a,b) = {(2,9)}. Kim claims π_a(R ∩ S) = π_a(R) ∩ π_a(S). Why does this example disprove the claim?
- Intersection cannot compare tuples containing more than one attribute
- Projection hides the differing b values and creates a shared a value
- Projection changes the original a values before comparing their membership