Resources
- https://www.sqltutorial.org/wp-content/uploads/2016/04/SQL-cheat-sheet.pdf
- https://sql.sh/cours/jointures
- https://www.sql-practice.com
Queries
Filters
- AND
- OR
- IN
- BETWEEN
- LIKE
- IS NOT NULL
Jointures
- INNER JOIN
- NATURAL JOIN
- LEFT JOIN
- RIGHT JOIN
- FULL JOIN
- CROSS JOIN
ON ...
Others
- ... ORDER BY col ASC|DESC,
- ... LIMIT int OFFSET start
Definition
Base commands
List databases
show databases;
Select a database
use $databaseName;
List tables
show tables;
Get description of a table
desc $tableName;
Constraints
-
NOT NULL
-
DEFAULT
-
CHECK
-
UNIQUE
-
AUTO_INCREMENT
-
PRIMARY KEY
-
FOREIGN KEY
-
INDEX