STUDENT
Name Class DOB Gender City Marks Rohan XI 2008 M Delhi 85 Priya XII 2006 F Mumbai 92 Ankit XI 2007 M Delhi 88 Nidhi XII 2006 F Mumbai 90 Aarav IX 2009 M Kolkata 78 Simran XI 2007 F Chandigarh 94 Rahul XII 2006 M Pune 80
From the above table 'STUDENT', which query will return all the students from class 'XI'"?
STUDENT
| Name | Class | DOB | Gender | City | Marks |
|---|---|---|---|---|---|
| Rohan | XI | 2008 | M | Delhi | 85 |
| Priya | XII | 2006 | F | Mumbai | 92 |
| Ankit | XI | 2007 | M | Delhi | 88 |
| Nidhi | XII | 2006 | F | Mumbai | 90 |
| Aarav | IX | 2009 | M | Kolkata | 78 |
| Simran | XI | 2007 | F | Chandigarh | 94 |
| Rahul | XII | 2006 | M | Pune | 80 |
From the above table 'STUDENT', which query will return all the students from class 'XI'"?
Solution
Option 1 is correct because SELECT * returns every column, and WHERE Class = 'XI' keeps only the rows whose Class value equals 'XI'. This gives Rohan, Ankit and Simran.
Option 2: LIKE needs a column name before it (for example Class LIKE 'XI'). Here the column is missing, so the syntax is invalid.
Option 3: Class > 'XI' is a comparison, not a match. It also selects only Name and DOB, not all the student details.
Option 4: IN takes a list in brackets, such as Class IN ('XI'). IN = is invalid syntax.
Related questions:
2026: 23 May Shift 1
2026: 23 May Shift 2
2025: 16 May Shift 1
2026: 26 May Shift 1
2025: 3 June Shift 2
2025: 16 May Shift 1