logo

Question detail

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, check the answer, then read the explanation to understand the curriculum point.

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;

Model answer

What a good answer should say

  • SELECT Student.Name, Course.CourseName FROM Student JOIN Course ON Student.CourseID = Course.CourseID;

Explanation

Why this works

SELECT retrieves the requested columns from both tables. JOIN combines the tables, and ON states that matching CourseID values link the rows.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.