Database Fundamentals: SQL Queries and Relational Concepts
Core Database Concepts and Relational Algebra
Question 1: Cartesian Product Size
Question 1: S is a relation instance. If S has 6 tuples, how many tuples are there in the result of the following SQL query?
SELECT * FROM S S1, S S2;Answer: 36 (Calculated as 6 * 6, representing the Cartesian product of S with itself.)
Question 2: Maximum Tuples and Primary Keys
Question 2: Let R(A, B, C, D) be a relation, where (A, B, C) is the Primary Key (PK) of R, and attribute D cannot be NULL. Assume A's domain has 5 different values, B's domain has 2, C has 4, and D has 3. What is the maximum number of tuples that can be in an instance of R?
Answer: 40 (Calculated as 5 * 2 * 4. The maximum number of tuples is determined by the product of the domain sizes of the... Continue reading "Database Fundamentals: SQL Queries and Relational Concepts" »
with a size of 99.31 KB