1.Easy
What does GROUP BY do in a query?
- ARemoves rows with NULL values
- BPuts rows with the same values into groups so aggregates are computed per group
- CSorts the rows of the result alphabetically
- DJoins two tables on their common columns
2.Easy
Which aggregate function returns the average of a numeric column?
- AMEDIAN
- BAVG
- CMEAN
- DSUM
3.Easy
Which keyword sorts the result of a query?
- AARRANGE
- BORDER BY
- CGROUP BY
- DSORT
4.Medium
Second normal form (2NF) removes:
- APartial dependencies of non-key columns on part of a composite key
- BAll NULL values
- CTransitive dependencies between non-key columns via another non-key column
- DForeign keys
5.Medium
What does EXCEPT (called MINUS in Oracle) return?
- ARows that appear in both queries
- BRows of the first query that do not appear in the second
- CRows of the second query that do not appear in the first one
- DAll rows from both queries without duplicates
6.Medium
Which statement removes all rows of a table, keeps its structure and cannot take a WHERE clause?
- ADROP TABLE
- BALTER TABLE
- CTRUNCATE TABLE
- DDELETE FROM with a WHERE clause
7.Hard
What is the result of SELECT COUNT(col) FROM t if all values in col are NULL and the table has 10 rows?
- AAn error
- B0
- C10
- DNULL
8.Hard
When is a schedule of concurrent transactions called serializable?
- AWhen every transaction is given a serial number
- BWhen no transaction ever reads data
- CWhen its effect is equivalent to some serial execution of the same transactions
- DWhen the transactions run on one CPU only
Answer key
- 1. B · Puts rows with the same values into groups so aggregates are computed per group
- 2. B · AVG
- 3. B · ORDER BY
- 4. A · Partial dependencies of non-key columns on part of a composite key
- 5. B · Rows of the first query that do not appear in the second
- 6. C · TRUNCATE TABLE
- 7. B · 0
- 8. C · When its effect is equivalent to some serial execution of the same transactions
Full step-by-step solutions: practise this topic on examproblems.com.