Exercise: Find Older Students
Find all students older than 13 years.
Task
Select all students where age is greater than 13.
Solution
sql
1SELECT * FROM students
2WHERE age > 13;Expected Output
| id | name | age | course |
|---|---|---|---|
| 1 | Alice | 14 | Python |
| 3 | Carol | 15 | Python |
| 6 | Frank | 14 | HTML |
Practice More
sql
1-- Marks above 85
2SELECT * FROM students WHERE marks > 85;
3
4-- Age above 12
5SELECT * FROM students WHERE age > 12;
6
7-- Only names of high scorers
8SELECT name FROM students WHERE marks > 90;Challenge
Find students with marks above 80 and show only their name, course, and marks:
sql
1SELECT name, course, marks
2FROM students
3WHERE marks > 80;Quick Reference
| Operator | Meaning | Example |
|---|---|---|
< | Less than | age < 14 |
> | Greater than | marks > 80 |
= | Equal to | course = 'Python' |
!= | Not equal | grade != 'F' |
