SELECT column_name FROM table_name;
SELECT column1 = (SELECT column-name FROM table-name WHERE condition), column-names FROM table-name WEHRE condition
#sql select query
SELECT * FROM table_name;
-- Sorting col1 ASCending then col2 DESCending
SELECT col1, col2 FROM table_name ORDER BY col1 ASC, col2 DESC;
-- Filter on col1
SELECT col1, col2 FROM table_name WHERE col1 = 'a value';
-- Containing 'searched'
SELECT col1, col2 FROM table_name WHERE col1 LIKE '%searched%';
-- All different values
SELECT DISTINCT col1 FROM table_name;
-- Simple sum
SELECT col1, sum(col2) FROM table_name GROUP BY col1;
Projection = Select the columns in
a table that are returned by a query
Selection = Selects the rows in a
table that are returned by a query
Join = Brings together data that is
stored in different tables by
specifying the link between them