Skip
Arish's avatar

12. Practice - Less Than


Exercise: Find Low Scores

Find all students with marks below 75.

Task

Select all students where marks are less than 75.

Solution

sql
1SELECT * FROM students
2WHERE marks < 75;

Expected Output

idnamemarksgrade
4David65C
6Frank71B
9Ivan58D

Practice Variations

sql
1-- Marks below 80
2SELECT * FROM students WHERE marks < 80;
3
4-- Age less than 13
5SELECT * FROM students WHERE age < 13;
6
7-- Show only names and marks
8SELECT name, marks FROM students WHERE marks < 75;

Combining with Other Clauses

sql
1-- Low scores, showing specific columns
2SELECT name, course, marks
3FROM students
4WHERE marks < 75;

Think About It

  • Does < 75 include 75? No!
  • To include 75, you'd use <= 75

We'll learn about <= in the next chapter!