1.Easy
What does a CROSS JOIN return?
- AOnly rows that do not match
- BEvery combination of rows from the two tables
- CThe rows of the first table only
- DOnly the rows that match on a shared key column
2.Easy
In the relational model, what is a row of a table called?
- AA tuple
- BAn attribute
- CA domain
- DA schema
3.Easy
GRANT and REVOKE belong to which part of SQL?
- AData Query Language (DQL)
- BData Control Language (DCL)
- CData Definition Language (DDL)
- DData Manipulation Language (DML)
4.Medium
What does SELECT SUM(amount) FROM orders return when the WHERE clause matches no rows?
- AAn empty string
- BNULL
- CAn error
- D0
5.Medium
Why does SELECT price * 2 AS double_price FROM t WHERE double_price > 10 fail in most databases?
- AWHERE is evaluated before the SELECT list, so the alias does not exist yet
- BAliases may not contain an underscore
- CWHERE can only compare text columns
- DArithmetic is not allowed in the SELECT list
6.Medium
A LEFT JOIN returns:
- AAll rows from the right table only
- BOnly matching rows from both tables
- CRows that match in neither table
- DAll rows from the left table and matching rows from the right, with NULLs where there is no match
7.Hard
Why is SELECT dept, name, COUNT(*) FROM emp GROUP BY dept invalid in standard SQL?
- Adept must appear inside an aggregate function
- Bname is neither grouped nor aggregated, so it has no single value per group
- CGROUP BY must list all columns of the table
- DCOUNT(*) cannot be used together with GROUP BY
8.Hard
What does the following return: SELECT name FROM students WHERE grade > (SELECT AVG(grade) FROM students)?
- AStudents with the highest grade only
- BAn error because subqueries are not allowed in WHERE
- CThe average grade of all students
- DStudents with a grade above the average grade
Answer key
- 1. B · Every combination of rows from the two tables
- 2. A · A tuple
- 3. B · Data Control Language (DCL)
- 4. B · NULL
- 5. A · WHERE is evaluated before the SELECT list, so the alias does not exist yet
- 6. D · All rows from the left table and matching rows from the right, with NULLs where there is no match
- 7. B · name is neither grouped nor aggregated, so it has no single value per group
- 8. D · Students with a grade above the average grade
Full step-by-step solutions: practise this topic on examproblems.com.