Skip to content

Language

Sign in

Example 1: Top students, best first

Open one step at a time. Try the next step yourself first.

  1. Step 1. Table STUDENT(RollNo, Name, Class, Marks).
  2. Show step 2

    SELECT Name, Marks FROM STUDENT WHERE Marks > 80 ORDER BY Marks DESC;

  3. Show step 3

    Only rows with Marks above 80 appear, highest first.

Example 2: Average marks per class

Open one step at a time. Try the next step yourself first.

  1. Step 1. SELECT Class, AVG(Marks) FROM STUDENT GROUP BY Class;
  2. Show step 2

    Each class forms one group.

  3. Show step 3

    Add HAVING AVG(Marks) > 70 to keep only classes averaging above 70.

Reviewed by EduFlint team on 1 Dec 2026 · version 1

Written by us for this site. Independent; not affiliated with NCERT or CBSE.

Report a mistake

Looking for another topic?