1.Easy
Which SQL statement retrieves data from a table?
- AUPDATE
- BINSERT
- CSELECT
- DCREATE
2.Easy
Which SQL statement adds new rows to a table?
- AUPDATE
- BSELECT
- CALTER
- DINSERT
3.Easy
What is a candidate key?
- AA set of columns shared between two tables to link their rows
- BA minimal set of columns that uniquely identifies each row
- CA column that is waiting to become a foreign key
- DAny column that contains NULL values
4.Medium
What does the "A" in ACID stand for?
- AAggregation
- BAvailability
- CAccuracy
- DAtomicity
5.Medium
Why are indexes created on columns?
- ATo save disk space
- BTo prevent NULL values
- CTo make inserts and updates faster on those columns
- DTo speed up searches and joins on those columns
6.Medium
Why can a table have only one clustered index?
- AThe SQL standard forbids more than one index on a table
- BClustered indexes use too much memory
- CClustered indexes can only be on the primary key
- DThe rows can be stored physically in only one order
7.Hard
What does SELECT name, dept, AVG(salary) OVER (PARTITION BY dept) FROM emp return?
- AOne row per department with its average salary
- BAn error because name is not in a GROUP BY
- COnly employees who earn more than their department average
- DEvery employee row together with the average salary of their department
8.Hard
What does a FULL OUTER JOIN return?
- AOnly matching rows
- BOnly unmatched rows
- CThe Cartesian product, pairing each row of one table with every row of the other
- DAll rows from both tables, matched where possible and NULL-filled otherwise
Answer key
- 1. C · SELECT
- 2. D · INSERT
- 3. B · A minimal set of columns that uniquely identifies each row
- 4. D · Atomicity
- 5. D · To speed up searches and joins on those columns
- 6. D · The rows can be stored physically in only one order
- 7. D · Every employee row together with the average salary of their department
- 8. D · All rows from both tables, matched where possible and NULL-filled otherwise
Full step-by-step solutions: practise this topic on examproblems.com.