Bird
0
0

Which of the following is the correct syntax for a non-equi join using the '<' operator between tables A and B on column x?

easy📝 Syntax Q3 of 15
SQL - Advanced Joins
Which of the following is the correct syntax for a non-equi join using the '<' operator between tables A and B on column x?
ASELECT * FROM A, B WHERE A.x = B.x;
BSELECT * FROM A JOIN B WHERE A.x < B.x;
CSELECT * FROM A JOIN B ON A.x < B.x;
DSELECT * FROM A JOIN B ON A.x = B.x;
Step-by-Step Solution
Solution:
  1. Step 1: Understand JOIN syntax

    JOIN requires ON clause to specify join condition, including non-equi conditions.
  2. Step 2: Identify correct use of '<' in ON clause

    Using ON A.x < B.x is valid for non-equi join; WHERE clause is not for join conditions.
  3. Final Answer:

    SELECT * FROM A JOIN B ON A.x < B.x; -> Option C
  4. Quick Check:

    Non-equi join syntax uses ON with comparison [OK]
Quick Trick: Use ON with comparison operators for non-equi joins [OK]
Common Mistakes:
MISTAKES
  • Using WHERE instead of ON for join condition
  • Using '=' operator for non-equi join
  • Confusing join syntax with cross join

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes