Consider the following tables in a database SCHOOL. Student Table: AdmNo SNAME…

2022

Consider the following tables in a database SCHOOL.

Student Table:
AdmNo   SNAME
101     AMAR
205     MARIA
410     MALALA

Teacher Table:
T_ID    TNAME
T05     AMAN
T06     NUSRAT

Required Output Table:
SNAME   TNAME
AMAR    AMAN
MARIA   AMAN
MALALA  AMAN
AMAR    NUSRAT
MARIA   NUSRAT
MALALA  NUSRAT

Which SQL statement produces the required output?

  1. A.

    SELECT SNAME, TNAME FROM STUDENT, TEACHER;

  2. B.

    SELECT SNAME FROM STUDENT, TNAME FROM TEACHER;

  3. C.

    SELECT SNAME, TNAME FROM STUDENT X TEACHER;

  4. D.

    SELECT SNAME FROM STUDENT, SELECT TNAME FROM TEACHER;

Attempted by 1511 students.

Show answer & explanation

Correct answer: A

The statement SELECT SNAME, TNAME FROM STUDENT, TEACHER; creates a Cartesian Product (Cross Join). Each student record is paired with every teacher record, producing 3 × 2 = 6 rows, which matches the given output.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Up Lt Grade Assistant Teacher 2025