Lesson 2 of 9
SELECT Basics
SELECT is the most common SQL command. It retrieves data from a table. Use * to get all columns, or list specific column names. Always end SQL statements with a semicolon.
SQL
-- Get all columns and rows
SELECT * FROM users;
-- Get specific columns only
SELECT name, email FROM users;
-- Get unique values only
SELECT DISTINCT country FROM users;