Exam-style question
Try this first
Which SQL statement retrieves the names of students and the names of the courses they take from Student and Course tables linked by CourseID?.
- A.SELECT Student.Name, Course.CourseName FROM Student JOIN Course ON Student.CourseID = Course.CourseID;
- B.SELECT Student.Name, Course.CourseName FROM Student DELETE Course ON Student.CourseID = Course.CourseID;
- C.INSERT Student.Name, Course.CourseName INTO Student JOIN Course ON Student.CourseID = Course.CourseID;
- D.UPDATE Student.Name, Course.CourseName FROM Student JOIN Course ON Student.CourseID = Course.CourseID;
Answer and explanation
Concise answer
SELECT Student.Name, Course.CourseName FROM Student JOIN Course ON Student.CourseID = Course.CourseID;
Why this is correct
SELECT retrieves the requested columns from both tables. JOIN combines the tables, and ON states that matching CourseID values link the rows.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
