Now that you understand SQL’s structure, it's time to focus on its most commonly used command: SELECT
.
The SELECT
statement is used to read data from a table. You specify the columns you want, and SQL returns only that information.
Here’s a basic example:
SELECT name, age FROM students;
This query retrieves only the name
and age
columns from the students
table.
If you want to retrieve all columns from a table, you can use the asterisk *
symbol:
SELECT * FROM students;
This returns every column for every row in the table.