📑 CHAPTER PRACTICE

CS403 - Database Management Systems – Relational Algebra

Practice 10 verified multiple choice questions per batch with instant answer reveal and comprehensive solutions.

Showing 110 of 12 Questions
Page 1 of 2
Q1❓ MCQ📑 Lec 17Medium🔁RepeatedHigh-Yield💡Conceptual
In relational algebra, which of the following operators is used to select specific columns (attributes) vertically from a single table while discarding all others?
💻 text Snippet
∏ stId, stName (STUDENT)
  1. A.Project operator
  2. B.Cartesian operator
  3. C.Select operator
  4. D.Conjugate operator
Q2❓ MCQ📑 Lec 17Medium🔁RepeatedHigh-Yield💡Conceptual🌟Starred
If relation M has C tuples (rows) and relation N has D tuples (rows), how many total tuples will their resulting Cartesian product (M x N) contain?
💻 text Snippet
COURSE X STUDENT
  1. A.C + D
  2. B.C * D
  3. C.C ^ D
  4. D.C - D
Q3❓ MCQ📑 Lec 17Medium🔁RepeatedHigh-Yield💡Conceptual🌟Starred
In relational algebra, which of the following pairs represent unary operations, meaning they operate strictly on a single input relation?
💻 text Snippet
'-- Relational Algebra Unary Operations:
-- σ Curr_Sem > 3 (STUDENT)
-- ∏ FacId, Salary (FACULTY)
  1. A.SELECT and CARTESIAN
  2. B.UNION and PROJECT
  3. C.SELECT and PROJECT
  4. D.PROJECT and CARTESIAN
Q4❓ MCQ📑 Lec 17Medium🔁RepeatedHigh-Yield💡Conceptual🌟Starred
Consider two union-compatible database relations representing employee records from two different software house branches: 1. 'Lahore_Branch(EmpName, Designation, Age, Salary)' 2. 'Islamabad_Branch(EmpName, Designation, Age, Salary)' Which relational algebra operation should be applied to find only those employees who work in both branches with identical details, and what is its mathematical representation?
💻 text Snippet
Lahore_Branch ∩ Islamabad_Branch
  1. A.Intersection Operation; represented as: Lahore_Branch ∩ Islamabad_Branch
  2. B.Union Operation; represented as: Lahore_Branch ∪ Islamabad_Branch
  3. C.Set-Difference Operation; represented as: Lahore_Branch - Islamabad_Branch
  4. D.Cartesian Product Operation; represented as: Lahore_Branch X Islamabad_Branch
Q5❓ MCQ📑 Lec 17Hard🔁RepeatedHigh-Yield💡Conceptual🌟Starred
Consider two database relations, Student(Fname, Lname, MajorCode) and Instructor(First_Name, Last_Name, DeptID), where Fname and First_Name, Lname and Last_Name share compatible character domains respectively. Which of the following statements is correct regarding their relational algebra set compatibility?
💻 sql Snippet
'-- Relational Set Difference query (Students not Instructors):
SELECT Fname, Lname FROM Student
EXCEPT
SELECT First_Name, Last_Name FROM Instructor;
  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 (number of columns) and domain-compatible attributes (same type of tuples).
  3. C.Set operations like Cartesian Product and Division can only be applied on these relations if they are union-compatible.
  4. D.To find students who are not instructors, we must perform the relational algebra Division operation (Student ÷ Instructor).
Q6❓ MCQ📑 Lec 17Hard🔁RepeatedHigh-Yield💡Conceptual
Consider the relations Student(Fname, Lname, MajorCode) and Instructor(First_Name, Last_Name, DeptID) representing university members, where Fname and First_Name, and Lname and Last_Name share compatible character domains respectively. Which of the following statements is correct regarding their relational algebra union-compatibility?
💻 sql Snippet
'-- Relational Set Difference query (Students not Instructors):
SELECT Fname, Lname FROM Student
EXCEPT
SELECT First_Name, Last_Name FROM Instructor;
  1. A.The two relations are not union-compatible since their attribute names differ.
  2. B.The two relations are union-compatible since they have the same type of tuples (same degree and domain-compatible attribute positions).
  3. C.The set operations such as CARTESIAN PRODUCT and DIVISION can be applied on these two relations only if they are union-compatible.
  4. D.To find out the students who are not instructors, it is necessary to perform the operation Student ÷ Instructor.
Q7❓ MCQ📑 Lec 17Easy🔁RepeatedHigh-Yield💡Conceptual
In standard relational database management systems and SQL, what is the precise mathematical behavior and output of a CROSS JOIN (Cartesian Product) executed between two tables, Table_A (containing R rows and C columns) and Table_B (containing S rows and D columns)?
💻 sql Snippet
SELECT * FROM Table_A CROSS JOIN Table_B;
  1. A.It returns a table containing R + S rows and C + D columns, where unmatched rows are represented as NULL values.
  2. B.It returns a table containing R * S rows and C + D columns, pairing every single row from Table_A with every possible row from Table_B.
  3. C.It returns a table containing only matching rows where Table_A's primary key is identical to Table_B's foreign key.
  4. D.It returns a table with R * S rows and C * D columns, containing only unique non-duplicate rows across both relations.
Q8❓ 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 with respect to the two relations?
💻 sql Snippet
'-- Relational Set Difference query (Students not Instructors):
SELECT Fname, Lname FROM Student
EXCEPT
SELECT First_Name, Last_Name FROM Instructor;
  1. A.The two relations are not union-compatible since their attribute names differ.
  2. B.The two relations are union-compatible since they have the same type of tuples (same degree and domain-compatible attributes).
  3. C.The set operations such as CARTESIAN PRODUCT and DIVISION can be applied on these two relations.
  4. D.To find out the students who are not instructors, it is necessary to perform the operation Student ÷ Instructor.
Q9❓ 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.
Q10❓ MCQ📑 Lec 17Hard🔁RepeatedHigh-Yield💡Conceptual🌟Starred
Consider two database relations representing members of a university department: 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 strictly correct regarding the relational algebra union-compatibility of these two relations?
💻 sql Snippet
'-- Relational Set Difference query (Students not Instructors):
SELECT Fname, Lname FROM Student
EXCEPT
SELECT First_Name, Last_Name FROM Instructor;
  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 (number of attributes) and domain-compatible attribute positions (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 find out the students who are not instructors, it is necessary to perform the relational algebra Division operation (Student ÷ Instructor).