CREATE TABLE table_name(
column_name TYPE CONSTRAINT1 CONSTRAINT2,
another_column TYPE CONSTRAINT1
);
DROP TABLE table_name;
SHOW TABLES;
INT
VARCHAR(length)
PRIMARY KEY
NOT NULL
UNIQUE
DEFAULT 'default'
AUTO_INCREMENT
SELECT column_name,another_column FROM table_name; : select specific columns
SELECT * FROM table_name; : select all columns
SELECT column_name,another_column FROM table_name WHERE column_name='something'; : select specific columns matching the condition
SELECT * FROM table_name WHERE column_name='something'; : select all columns matching the condition
UPDATE table_name SET column_name='new_data'; : update all rows from column
UPDATE table_name SET column_name='new_data' WHERE column_name='something'; : update specific column matching the condition
UPDATE table_name SET column_name='new_data', another_column='new_data' WHERE column_name='something'; : update specific columns matching the condition
DELETE FROM table_name; : deletes all rows from the table
DELETE FROM table_name WHERE column_name='something'; : deletes all rows from the table matching the condition
ORDER BY column_name : order the result by the given columnin ascending order
ORDER BY column_name DESC : order the result by the given columnin descending order
LIMIT number : limit the number of rows gotten from the result
IN (value1, value2, value3) : if like an OR for every value
DISTINCT : don't get duplicates from the result
= : equals
<> : not equals
> : greater than
< : less than
>= : greater than or equal
<= : less than or equal
OR
AND
-- This is an inline comment
/*
This is a multiline comment
*/