Exercise: With Conditions
Combine high-scoring and low-scoring students.
Solution
sql
1SELECT name, 'High' AS type FROM students WHERE marks > 80
2UNION
3SELECT name, 'Low' AS type FROM students WHERE marks < 50;
Combine high-scoring and low-scoring students.
1SELECT name, 'High' AS type FROM students WHERE marks > 80
2UNION
3SELECT name, 'Low' AS type FROM students WHERE marks < 50;