The parts of a SELECT statement are:
SELECT FROM WHERE GROUP BY HAVING ORDER BY FOR XML OPTION
By default, ALL is assumed in SELECT, thus including every row. Using SELECT DISTINCT excludes duplicate rows. Note that you can also use DISTINCT in aggregate functions, like below:
SELECT COUNT (DISTINCT Column) FROM Table
You can use ORDER BY on any column on the table even if it is not returned or not part of the SELECT list. The FOR XML clause is used for outputting XML data while the OPTION clause is for making query hints.
The INSERT statement can take either of the two following forms:
INSERT INTO Table (Column1, Column2) VALUES (Value1, Value2) INSERT INTO Table (Column1, Column2) SELECT ...
Note that the column list are optional on both forms.
The parts of an UPDATE statement are:
UPDATE SET FROM WHERE
An UPDATE can be created from multiple tables but only one table is affected, meaning only one table can be the subject of an update action.
The DELETE statement has the shortest syntax. Just provide the table name and optionally a WHERE clause.