Bird
0
0

You have a table with columns start_date and end_date. Which CHECK constraint ensures end_date is always after start_date?

hard📝 Application Q9 of 15
SQL - Table Constraints
You have a table with columns start_date and end_date. Which CHECK constraint ensures end_date is always after start_date?
ACHECK (end_date > start_date)
BCHECK (start_date > end_date)
CCHECK (end_date >= start_date)
DCHECK (start_date >= end_date)
Step-by-Step Solution
Solution:
  1. Step 1: Understand the date order requirement

    end_date must be strictly after start_date.
  2. Step 2: Analyze each CHECK condition

    CHECK (end_date > start_date) correctly enforces end_date > start_date. CHECK (end_date >= start_date) allows equality, which is not required.
  3. Final Answer:

    CHECK (end_date > start_date) -> Option A
  4. Quick Check:

    Use > to enforce strict order [OK]
Quick Trick: Use > to ensure one date is after another [OK]
Common Mistakes:
MISTAKES
  • Using >= allowing equal dates
  • Reversing the date comparison
  • Using <= or < incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes