SELECT
SELECT chooses the columns and FROM chooses the table. Use * to get every column, but in real projects list the columns you need because it is faster and clearer.
Example
SELECT name, score
FROM students;Result
name | score Ada | 92 Kofi | 78 Amina | 85 Wanjiru | 64 Tunde | 71 Zainab | 88 Sipho | 59 Esi | NULL
Example
SELECT *
FROM courses;Result
id | title | price | level 1 | Intro to HTML | 0 | Beginner 2 | CSS Basics | 5000 | Beginner 3 | JavaScript | 15000 | Intermediate 4 | Python | 12000 | Beginner 5 | SQL | 8000 | Beginner
Exercise
Select every column.
SELECT FROM students;
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.