Using JOIN, which of the following MySQL query is almost equivalent to: SELECT…
2023
Using JOIN, which of the following MySQL query is almost equivalent to: SELECT NAME, MARKS FROM STUDENT, RESULT WHERE STUDENT.ROLL = RESULT.ROLL;
- A.
SELECT NAME, MARKS FROM STUDENT JOIN RESULT;
- B.
SELECT NAME, MARKS FROM STUDENT EQUI JOIN RESULT;
- C.
SELECT NAME, MARKS FROM STUDENT NATURAL JOIN RESULT;
- D.
SELECT NAME, MARKS FROM STUDENT, RESULT;
Attempted by 1430 students.
Show answer & explanation
Correct answer: C
Correct equivalent using JOIN: SELECT NAME, MARKS FROM STUDENT JOIN RESULT ON STUDENT.ROLL = RESULT.ROLL; Explanation: The original query uses an implicit inner join by listing both tables and putting the equality condition in the WHERE clause. That is equivalent to an explicit INNER JOIN (or JOIN) with an ON clause that specifies the equality.