Question 6

Consider the following tables in a database SPORTS : Table 1 : STUDENTS

Consider the following tables in a database SPORTS : Table 1 : STUDENTS ADMNO | SNAME 101 | AMAR 205 | MARIA 410 | MALALA Table 2 : GAMES GAMEID | GNAME G03 | CRICKET G05 | FOOTBALL Which of the following SQL Command will produce an output as : SNAME | GNAME AMAR | CRICKET MARIA | CRICKET MALALA | CRICKET AMAR | FOOTBALL MARIA | FOOTBALL MALALA | FOOTBALL
  1. ASELECT SNAME, GNAME FROM STUDENTS, GAMES;
  2. BSELECT SNAME, GNAME FROM STUDENTS X GAMES;
  3. CSELECT SNAME FROM STUDENTS, GNAME FROM GAMES;
  4. DSELECT SNAME FROM STUDENTS, SELECT GNAME FROM GAMES;
Show answerHide answer

Correct answer: (A) SELECT SNAME, GNAME FROM STUDENTS, GAMES;

Explanation

Listing two tables with no join condition gives their Cartesian product: every student paired with every game (3 × 2 = 6 rows), which matches the output.

From DSSSB TGT Computer Science Practice Set 2

This is question 6 of DSSSB TGT Computer Science Practice Set 2. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.