logo

AQA A-Level Computer Science practice

Which SQL statement retrieves the names of students and the names of the courses they take from Student and Course tables linked by CourseID?

Try the question first, then check the answer and practise the same topic again.

At a glance

MCQ

Type

practice

Style

Topic

Structured Query Language (SQL)

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?.

  1. A.SELECT Student.Name, Course.CourseName FROM Student JOIN Course ON Student.CourseID = Course.CourseID;
  2. B.SELECT Student.Name, Course.CourseName FROM Student DELETE Course ON Student.CourseID = Course.CourseID;
  3. C.INSERT Student.Name, Course.CourseName INTO Student JOIN Course ON Student.CourseID = Course.CourseID;
  4. 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.

Related flashcards

No flashcards are published for this page yet.

Related practice questions