Dayrvia
SQL

Databases · Practice questions

Try 8 questions on Databases, then read the explanations and review the related concepts.

Practice questions

Choose an answer and move to the next question. Grade the last one to see explanations and review links.

8 questions
Q1 How many rows satisfy WHERE score >= 80?
scores: 60, 80, 90
Q2 What does COUNT(score) return?
scores: 75, NULL, 0
Q3 Which clause keeps only teams with at least three rows?
SELECT team, COUNT(*) FROM results
GROUP BY team
Q4 Member A has two applications and B has none. With members on the left, how many rows does a LEFT JOIN produce?
Q5 Which condition selects missing email values?
Q6 How many rows satisfy WHERE score <> 0?
scores: NULL, 0, 5, 10
Q7 With initial stock 9 and no other changes, what is the final quantity?
BEGIN;
UPDATE stock SET qty = qty - 2 WHERE id = 1;
ROLLBACK;
Q8 Which property makes a transaction’s changes all take effect or none take effect?
Original practice questions written for Dayrvia.