1.Easy
What does a CHECK constraint do?
- AVerifies the user's password
- BRejects rows whose values do not satisfy a condition
- CCounts the rows in a table
- DChecks whether a table exists before a query is run on it
2.Easy
What is a candidate key?
- AAny column that contains NULL values
- BA column that is waiting to become a foreign key
- CA minimal set of columns that uniquely identifies each row
- DA set of columns shared between two tables to link their rows
3.Easy
Which keyword gives a column or table a temporary alternative name in a query?
- ARENAME
- BAS
- CALIAS
- DNAME
4.Medium
Second normal form (2NF) removes:
- AForeign keys
- BPartial dependencies of non-key columns on part of a composite key
- CAll NULL values
- DTransitive dependencies between non-key columns via another non-key column
5.Medium
What does the "A" in ACID stand for?
- AAggregation
- BAccuracy
- CAvailability
- DAtomicity
6.Medium
What does SELECT name, CASE WHEN grade >= 5.5 THEN 'pass' ELSE 'fail' END FROM results return?
- AEach name with the label 'pass' or 'fail' depending on the grade
- BOnly the students who passed
- CAn error because CASE is not allowed in SELECT
- DThe number of students who passed and failed
7.Hard
Table enrolment(student_id, course_id, student_name, grade) has the key (student_id, course_id). Which normal form does it violate?
- ANone, it is in BCNF
- BFirst normal form, because the grade column does not hold atomic values
- CThird normal form only, because grade depends on student_name
- DSecond normal form, because student_name depends on student_id only
8.Hard
What is a covering index for a query?
- AAn index that contains all columns the query needs, so the table itself need not be read
- BAn index on the primary key only
- CAn index that is rebuilt every night
- DAn index that covers every column of every table
Answer key
- 1. B · Rejects rows whose values do not satisfy a condition
- 2. C · A minimal set of columns that uniquely identifies each row
- 3. B · AS
- 4. B · Partial dependencies of non-key columns on part of a composite key
- 5. D · Atomicity
- 6. A · Each name with the label 'pass' or 'fail' depending on the grade
- 7. D · Second normal form, because student_name depends on student_id only
- 8. A · An index that contains all columns the query needs, so the table itself need not be read
Full step-by-step solutions: practise this topic on examproblems.com.