Basic Statement
list up useful statements, just find the statement you need with ctrl+f
Reference: https://www.w3schools.com/sql/default.asp
This statement is for MySQL Syntax.
Select sub columns from the table
Select all columns from the table (* means all)
Select sub columns who have distanct values
Filter records based on a condition
Operator: =, >, <, >=, <=, <>, BETWEEN, LIKE(To find a pattern), IN(Multple values)
Connect several conditions with logical operator: AND, OR, NOT
Sort the table based on the col
Insert new records into a table
Check for NULL
Update for modifying the existing records
Under this condition, we modify the value from col1 with new value, so basically update statment is for changing the value in column.
Delete some records(row records)
Select top n data
You can use more function like min, max, count, avg, and sum
Find the data which of column matches specific string pattern with regex.
Aliases for giving name to table or column
(Because this statement is just temporary, so an alias only exists for the duration of that query.)
Last updated