Computer Science · Database Management System
Consider the following tables in a MySQL database: Table: SUBJECTS +---------+-----------------------+------+------+ | SUBCODE | SUBNAME | MAXT | MAXP | +---------+-----------------------+------+------+ | 065 | Informatics Practices | 70 | 30 | | 083 | Computer Science | 70 | 30 | | 301 | English Core | 80 | 20 | +---------+-----------------------+------+------+ Table: RESULT +-------+---------+--------+--------+ | ROLL | SUBCODE | TMARKS | PMARKS | +-------+---------+--------+--------+ | 10045 | 083 | 70 | 30 | | 10135 | 065 | 56 | 29 | | 10231 | 065 | 63 | 30 | | 10345 | 083 | 56 | 29 | +-------+---------+--------+--------+ Select the correct SQL command to display the subject name (SUBNAME) and the total number of students registered for that subject in the RESULT table.
- 1SELECT SUBNAME, COUNT() FROM SUBJECTS NATURAL JOIN RESULT GROUP BY SUBNAME;✓
- 2SELECT SUBNAME, COUNT() FROM SUBJECTS NATURAL JOIN RESULT ORDER BY SUBNAME;
- 3SELECT SUBNAME, COUNT() FROM SUBJECTS, RESULT ORDER BY SUBNAME;
- 4SELECT SUBNAME, COUNT() FROM SUBJECTS, RESULT GROUP BY SUBNAME;
Correct answer
SELECT SUBNAME, COUNT() FROM SUBJECTS NATURAL JOIN RESULT GROUP BY SUBNAME;
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on Database Management System?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · Database Management System