โ† All SQL Flashcard Decks

Filtering with WHERE Clause Flashcards

7 cards from real SQL practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 Filtering with WHERE Clause flashcards as text
  1. Which operator is best to find customers whose city is one of several specific values?

    Answer: IN

    IN tests membership against a discrete list of values efficiently.

  2. What does WHERE score >= 60 AND score <= 90 equal?

    Answer: WHERE score BETWEEN 60 AND 90

    BETWEEN is the inclusive-range equivalent of two combined comparison operators.

  3. Which condition finds emails ending in '.com'?

    Answer: WHERE email LIKE '%.com'

    A leading % with '.com' at the end matches any value ending in .com.

  4. What happens with WHERE NOT (price IN (10, 20)) when price is NULL?

    Answer: The NULL row is not returned

    NOT IN with NULL involvement yields unknown, so the NULL row is excluded.

  5. Which combines two ranges: ages 18-25 OR 60-65?

    Answer: WHERE (age BETWEEN 18 AND 25) OR (age BETWEEN 60 AND 65)

    Two BETWEEN ranges joined by OR captures both non-contiguous bands.

  6. Why can filtering on an indexed column speed up a WHERE query?

    Answer: The index lets the engine locate matching rows without scanning all rows

    An index allows the database to seek matching rows instead of a full table scan.

  7. What does WHERE first_name = last_name compare?

    Answer: Two columns in the same row against each other

    WHERE can compare two columns, returning rows where their values are equal.