Practice mode DBMS and SQL

For the relational algebra expression R union S to be valid, what must be true of R and S?

Correct answer A. They must have the same number of attributes with compatible domains

Explanation

Union, intersection and set difference need union-compatible operands: the same arity (number of attributes), with the i-th attribute of each relation drawn from compatible domains. The number of tuples can differ freely. Sharing a common attribute name is what natural join relies on, not union. SQL's UNION has the same rule: both queries must return the same number of columns with compatible types.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.