Skip to main contentSkip to solution

STUDENT

NameClassDOBGenderCityMarks
RohanXI2008MDelhi85
PriyaXII2006FMumbai92
AnkitXI2007MDelhi88
NidhiXII2006FMumbai90
AaravIX2009MKolkata78
SimranXI2007FChandigarh94
RahulXII2006MPune80

From the above table 'STUDENT', which query will return all the students from class 'XI'"?

Solution

✅ Correct Option: 1

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.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question