SQL SYNTAX
StatementSyntaxAND / ORSELECT column_name (s) FROM table_nameWHERE conditionAND | OR conditionALTER TABLE (add column) ALTER TABLE table_name ADD column_name datatypeALTER TABLE (drop column) ALTER TABLE table_name DROP COLUMN column_nameAS (alias for column) SELECT column_name AS column_aliasFROM table_nameAS (alias for table) SELECT column_nameFROM table_name AS table_aliasBETWEENSELECT column_name (s) FROM table_nameWHERE column_nameBETWEEN value1 AND value2CREATE DATABASECREATE DATABASE database_nameCREATE INDEXCREATE INDEX index_nameON table_name (column_name) CREATE TABLECREATE TABLE table_name (column_name1 data_type, column_name2 data_type, .......) CREATE UNIQUE INDEXCREATE UNIQUE INDEX index_nameON Table_name (column_name) Create ViewCreate View View_name asselect column_name (s) from table_namewhere conditiondelete from delendete from table_name (NOTE: DELETES The Entire Table !!
) OrDELETE FROM table_nameWHERE conditionDROP DATABASEDROP DATABASE database_nameDROP INDEXDROP INDEX table_name.index_nameDROP TABLEDROP TABLE table_nameGROUP BYSELECT column_name1, SUM (column_name2) FROM table_nameGROUP BY column_name1HAVINGSELECT column_name1, SUM (column_name2) FROM table_nameGROUP BY column_name1HAVING SUM (column_name2) condition valueINSELECT column_name (s) FROM table_nameWHERE column_nameIN (value1, value2, ..) INSERT INTOINSERT INTO table_nameVALUES (value1, value2, ....) orINSERT INTO table_name (column_name1, column_name2, ...) VALUES (value1, value2, ....) LIKESELECT column_name (s) FROM table_nameWHERE column_nameLIKE patternORDER BYSELECT column_name (s) FROM table_nameORDER BY column_name [ASC | DESC] SELECTSELECT column_name (s) FROM table_nameSELECT * SELECT * FROM table_nameSELECT DISTINCTSELECT DISTINCT column_name (s) FROM table_nameSELECT INTO (used to create backup copies of tables) SELECT * INTO new_TABLE_NAMEFROM ORIGINAL_TABLE_NAME ORSELECT Column_Name (s) INTO New_TABLE_NAMEFR OM original_table_nameTRUNCATE TABLE (deletes only the data inside the table) TRUNCATE TABLE table_nameUPDATEUPDATE table_nameSET column_name = new_value [, column_name = new_value] WHERE column_name = some_valueWHERESELECT column_name (s) FROM table_nameWHERE conditionSource: http://www.w3schools.com/sql/sql_quickref .asp