All quizzesEasy
SQL Basics — Series 2
Preview — 3 of 10 questions
Which query returns products priced between 10 and 50, inclusive of both endpoints?
javascript
-- Table: products(id, name, price)ASELECT * FROM products WHERE price BETWEEN 10 AND 50;
BSELECT * FROM products WHERE price > 10 AND price < 50;
CSELECT * FROM products WHERE price IN (10, 50);
DSELECT * FROM products WHERE price RANGE 10 TO 50;
Which query returns all users located in France, Germany, or Spain?
javascript
-- Table: users(id, name, country)ASELECT * FROM users WHERE country = 'France' OR 'Germany' OR 'Spain';
BSELECT * FROM users WHERE country IN ('France', 'Germany', 'Spain');
CSELECT * FROM users WHERE country CONTAINS ('France', 'Germany', 'Spain');
DSELECT * FROM users WHERE country = ANY('France', 'Germany', 'Spain');
What does this query actually return?
javascript
SELECT * FROM products
WHERE category = 'Electronics' OR category = 'Books' AND price < 20;AAll products in Electronics or Books, priced under $20
BAn error — mixing AND and OR requires parentheses
CAll Electronics products regardless of price, plus only Books priced under $20 — because AND binds tighter than OR
DAll products priced under $20, regardless of category
Sign up free to play
Answer all 10 questions (7 more), see explanations for every answer, and track your score.