Bird
0
0

Which of the following is the correct syntax for an INNER JOIN with table aliases?

easy📝 Syntax Q12 of 15
SQL - INNER JOIN
Which of the following is the correct syntax for an INNER JOIN with table aliases?
ASELECT a.name, b.salary FROM employees a INNER JOIN salaries b ON a.id = b.emp_id;
BSELECT a.name, b.salary FROM employees AS a JOIN salaries b WHERE a.id = b.emp_id;
CSELECT a.name, b.salary FROM employees a INNER JOIN salaries b USING a.id = b.emp_id;
DSELECT a.name, b.salary FROM employees a JOIN salaries b ON a.id == b.emp_id;
Step-by-Step Solution
Solution:
  1. Step 1: Check INNER JOIN syntax

    Correct syntax uses INNER JOIN with ON clause for join condition.
  2. Step 2: Validate alias usage and condition

    Aliases 'a' and 'b' are used correctly; ON clause uses single '=' for comparison.
  3. Final Answer:

    SELECT a.name, b.salary FROM employees a INNER JOIN salaries b ON a.id = b.emp_id; -> Option A
  4. Quick Check:

    INNER JOIN + ON + aliases = correct syntax [OK]
Quick Trick: Use ON with single = for join condition [OK]
Common Mistakes:
MISTAKES
  • Using WHERE instead of ON for join condition
  • Using double equals '==' in SQL
  • Incorrect USING clause syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes