โ† 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 query finds products priced 100 or less OR with quantity above 50?

    Answer: WHERE price 50

    OR returns rows satisfying at least one of the two conditions exactly as written.

  2. What is the result of WHERE quantity NOT IN (1, 2, 3)?

    Answer: Rows where quantity is none of 1, 2, or 3

    NOT IN excludes rows matching any value in the list.

  3. Which condition matches strings containing 'sql' anywhere in the column?

    Answer: LIKE '%sql%'

    Percent signs on both sides match the substring anywhere within the value.

  4. How do you select rows where a column does have a value (not null)?

    Answer: WHERE column IS NOT NULL

    IS NOT NULL is the correct syntax to test for a present value.

  5. Given WHERE a = 1 OR b = 2 AND c = 3, which is evaluated first?

    Answer: b = 2 AND c = 3

    AND has higher precedence than OR, so the AND pair is evaluated first.

  6. Which query filters dates in the year 2025 using a range?

    Answer: WHERE order_date BETWEEN '2025-01-01' AND '2025-12-31'

    BETWEEN with start and end dates filters an inclusive date range.

  7. What does the ESCAPE clause do in a LIKE expression?

    Answer: Lets you treat wildcard characters as literals

    ESCAPE defines a character so wildcards like % or _ can be matched literally.