โ† 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. Why might WHERE bonus > 0 exclude rows where bonus is NULL?

    Answer: NULL comparisons yield unknown, not true

    Any comparison with NULL returns unknown, so those rows are not included.

  2. Which parentheses placement returns rows that are red AND (small OR medium)?

    Answer: WHERE color='red' AND (size='small' OR size='medium')

    Parentheses group the OR so it is required together with the red condition.

  3. What does WHERE name LIKE 'Sm_th' match?

    Answer: Smith and Smyth

    The underscore matches exactly one character, so Smith and Smyth both qualify.

  4. Which is the most readable equivalent of WHERE x = 1 OR x = 2 OR x = 3?

    Answer: WHERE x IN (1, 2, 3)

    IN provides a concise list-based alternative to multiple OR equalities.

  5. How does case sensitivity in WHERE string comparisons typically behave?

    Answer: It depends on the column's collation settings

    Whether comparisons are case-sensitive is governed by the collation of the column or database.

  6. Which query returns rows where discount is NULL or zero?

    Answer: WHERE discount IS NULL OR discount = 0

    You must test IS NULL separately and combine it with the zero check using OR.

  7. What does WHERE price * quantity > 1000 demonstrate?

    Answer: Expressions can be used in WHERE conditions

    WHERE can evaluate arithmetic expressions and compare the result.