Intermediate7 minFree practice

Find the three highest quiz scores

Sort results and limit them to the records you need.

Practice library
Read the taskTry your answerLearn from feedback

YOUR TASK

Return name and score, in that order, for the three highest scoring students. Use ORDER BY score DESC and LIMIT 3. There are no tied scores in the test datasets.

Give me a hint

DESC puts larger scores first. LIMIT controls how many rows are returned.

Show the worked solutionSELECT name, score FROM students ORDER BY score DESC LIMIT 3;

Sort before taking the first three rows. LIMIT without ORDER BY would return the first three source rows, not the highest scores.

Download starter file .SQL
ORDER BY & LIMIT labRuns in your browser

TABLE: STUDENTS

namescore
Ananya82
Arjun64
Meera91
Kabir75
Diya88
Rohan59

Tip: Ctrl / ⌘ + Enter checks your answer.

Practice subset: SELECT name, score FROM students; numeric score filters; ORDER BY score ASC/DESC; LIMIT. No database connection or changes.

Keep your curiosity going.

Browse all skills

YOUR LEARNING JOURNEY

Look how far you’ve come.

Your progress is saved in this browser. Clearing browser data removes it.

Manage saved progress

This removes your completed-challenge history from this browser.