1.Easy
In the relational model, what is a row of a table called?
- AA tuple
- BA schema
- CAn attribute
- DA domain
2.Easy
Which keyword gives a column or table a temporary alternative name in a query?
- ARENAME
- BAS
- CALIAS
- DNAME
3.Easy
What does a UNIQUE constraint on a column guarantee?
- ANo two rows have the same non-NULL value in that column
- BThe column cannot be changed after insert
- CThe column automatically becomes the primary key of the table
- DThe column values are sorted
4.Medium
Which query returns the number of orders per customer?
- ASELECT DISTINCT COUNT(*) FROM orders
- BSELECT customer_id FROM orders WHERE COUNT(*) > 0
- CSELECT customer_id, COUNT(*) FROM orders ORDER BY customer_id
- DSELECT customer_id, COUNT(*) FROM orders GROUP BY customer_id
5.Medium
Which statement removes all rows of a table, keeps its structure and cannot take a WHERE clause?
- ADROP TABLE
- BDELETE FROM with a WHERE clause
- CTRUNCATE TABLE
- DALTER TABLE
6.Medium
Which query returns the highest salary in each department?
- ASELECT dept, MAX(salary) FROM emp GROUP BY dept
- BSELECT dept, salary FROM emp WHERE salary = MAX(salary)
- CSELECT dept, MAX(salary) FROM emp ORDER BY dept
- DSELECT MAX(dept), salary FROM emp GROUP BY salary
7.Hard
Given the functional dependencies A → B, B → C and C → D on R(A, B, C, D), what is the closure A+?
- A{A}
- B{A, B}
- C{A, B, C, D}
- D{A, B, C}
8.Hard
What does a FULL OUTER JOIN return?
- AOnly matching rows
- BThe Cartesian product, pairing each row of one table with every row of the other
- CAll rows from both tables, matched where possible and NULL-filled otherwise
- DOnly unmatched rows
Answer key
- 1. A · A tuple
- 2. B · AS
- 3. A · No two rows have the same non-NULL value in that column
- 4. D · SELECT customer_id, COUNT(*) FROM orders GROUP BY customer_id
- 5. C · TRUNCATE TABLE
- 6. A · SELECT dept, MAX(salary) FROM emp GROUP BY dept
- 7. C · {A, B, C, D}
- 8. C · All rows from both tables, matched where possible and NULL-filled otherwise
Full step-by-step solutions: practise this topic on examproblems.com.