Skip
Arish's avatar

14. Practice - Greater Than


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

idnameagecourse
1Alice14Python
3Carol15Python
6Frank14HTML

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

OperatorMeaningExample
<Less thanage < 14
>Greater thanmarks > 80
=Equal tocourse = 'Python'
!=Not equalgrade != 'F'