Relational Algebra

Lecture 15: Relational Algebra

12 Questions12 MCQs0 Short Questions0 Long Questions
Showing 1112 of 12 Questions
Page 2 of 2
Q11❓ MCQ📑 Lec 17Hard🔁RepeatedHigh-Yield💡Conceptual🌟Starred
Consider two database relations, Student(Fname, Lname, MajorCode) and Instructor(First_Name, Last_Name, DeptID), where Fname/First_Name and Lname/Last_Name represent compatible character datatypes. Which of the following statements is correct regarding the relational algebra union-compatibility of these two relations?
💻 text Snippet
'-- Relational algebra union compatibility check:
-- Degree(R) == Degree(S) AND Domain(R.col_i) == Domain(S.col_i)
  1. A.The two relations are not union-compatible because their attribute names are different.
  2. B.The two relations are union-compatible because they share the same degree and compatible attribute domains (same type of tuples).
  3. C.Set operations like Cartesian Product and Division can only be applied if relations are union-compatible.
  4. D.To retrieve students who are not instructors, the division operator (Student / Instructor) must be applied.
Q12❓ MCQ📑 Lec 17Easy🔁RepeatedHigh-Yield💡Conceptual
Suppose you are given two database tables, 'Active_Students' and 'Honors_List', both containing identical, union-compatible columns. Which SQL set operator should be used to retrieve only those student records that exist in both tables concurrently?
💻 sql Snippet
SELECT stId, stName FROM Active_Students
INTERSECT
SELECT stId, stName FROM Honors_List;
  1. A.UNION
  2. B.EXCEPT
  3. C.INTERSECT
  4. D.MINUS