← SQL tutorial

SQL

SELECT

SELECT picks which columns you want back. * means "every column"; naming specific columns (comma-separated) returns just those.

Example: selecting specific columns

SELECT name, score FROM students;
name  | score
Ada   | 92
Chidi | 78
Musa  | 85

Naming exact columns instead of always using * matters for a real, practical reason once tables get wide, fetching only what you actually need is faster, uses less memory, and makes it obvious to anyone reading the query exactly what data it depends on.

Example
SELECT name, score FROM students;
Output
name  | score
Ada   | 92
Chidi | 78
Musa  | 85
Ready to go further?

These free tutorials are a preview, our Backend Development cohort covers it in depth, with a real project and a cohort alongside you. Active

Enroll in Backend Development
Don't miss out

Ready to build something real?

Create a free account to enroll in a track, and get notified the moment a cohort opens.

Create free account