1.Easy
Which keyword gives a column or table a temporary alternative name in a query?
- ANAME
- BAS
- CALIAS
- DRENAME
2.Easy
What is a primary key?
- AA column that may hold duplicate values but must never contain NULL
- BA password for the database
- CA column or set of columns that uniquely identifies each row
- DThe first column of every table
3.Easy
Which SQL statement changes values in rows that already exist?
- AINSERT
- BREPLACE COLUMN
- CUPDATE
- DMODIFY
4.Medium
What is a database trigger?
- ACode that runs automatically when a specified event such as INSERT, UPDATE or DELETE occurs on a table
- BA type of index that speeds up searches
- CA scheduled backup of the database
- DA query that a user runs by hand
5.Medium
Third normal form (3NF) removes:
- AComposite keys
- BRedundant indexes on columns that are not part of a key
- CTransitive dependencies between non-key attributes
- DAtomic values
6.Medium
Why can a table have only one clustered index?
- AClustered indexes can only be on the primary key
- BThe rows can be stored physically in only one order
- CThe SQL standard forbids more than one index on a table
- DClustered indexes use too much memory
7.Hard
Table b contains the values 1, 2 and NULL in column y. What does SELECT * FROM a WHERE x NOT IN (SELECT y FROM b) return?
- ANo rows at all
- BRows of a where x is not 1 or 2
- CEvery row of a
- DOnly rows of a where x is NULL
8.Hard
What does a FULL OUTER JOIN return?
- AThe Cartesian product, pairing each row of one table with every row of the other
- BAll rows from both tables, matched where possible and NULL-filled otherwise
- COnly unmatched rows
- DOnly matching rows
Answer key
- 1. B · AS
- 2. C · A column or set of columns that uniquely identifies each row
- 3. C · UPDATE
- 4. A · Code that runs automatically when a specified event such as INSERT, UPDATE or DELETE occurs on a table
- 5. C · Transitive dependencies between non-key attributes
- 6. B · The rows can be stored physically in only one order
- 7. A · No rows at all
- 8. B · All rows from both tables, matched where possible and NULL-filled otherwise
Full step-by-step solutions: practise this topic on examproblems.com.