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
| id | name | marks | grade |
|---|---|---|---|
| 4 | David | 65 | C |
| 6 | Frank | 71 | B |
| 9 | Ivan | 58 | D |
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
< 75include 75? No! - To include 75, you'd use
<= 75
We'll learn about <= in the next chapter!
