Bird
0
0

Given tables Staff and Teams with a common column TeamID, what does this query return?

medium📝 query result Q4 of 15
SQL - INNER JOIN
Given tables Staff and Teams with a common column TeamID, what does this query return?
SELECT s.Name, t.TeamName FROM Staff s JOIN Teams t ON s.TeamID = t.TeamID;
AAll teams regardless of staff membership
BAll staff members regardless of team membership
COnly staff members who belong to a team with matching TeamID
DStaff and teams combined without any condition
Step-by-Step Solution
Solution:
  1. Step 1: Understand INNER JOIN behavior

    INNER JOIN returns rows where the join condition matches.
  2. Step 2: Analyze the ON clause

    Rows are matched where s.TeamID = t.TeamID.
  3. Final Answer:

    Only staff members who belong to a team with matching TeamID -> Option C
  4. Quick Check:

    INNER JOIN filters to matching keys only [OK]
Quick Trick: INNER JOIN returns only matching rows [OK]
Common Mistakes:
MISTAKES
  • Assuming all staff are returned regardless of team
  • Thinking unmatched teams appear
  • Believing join ignores ON condition

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes