<aside>
📚 Notes from: SQL Ultimate Course by Data With Baraa — PDF 02 (Part 2)
</aside>
What is SELECT?
SELECT is a DQL (Data Query Language) command used to ask questions and retrieve data from a database. It does NOT modify data.
SELECT *
FROM customers
SQL Query Clauses Overview
- SELECT — which columns to return
- DISTINCT — remove duplicate rows
- TOP / LIMIT — restrict number of rows
- FROM — which table to read
- JOIN — combine multiple tables
- WHERE — filter rows before aggregation
- GROUP BY — group rows by a category and aggregate
- HAVING — filter groups after aggregation
- ORDER BY — sort the result
SELECT * — All Columns
Retrieves every column from the table. Equivalent to saying 'give me everything'.
SELECT *
FROM customers