Professional Documents
Culture Documents
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
The MIN() function returns the smallest value of the selected column.
The MAX() function returns the largest value of the selected column.
SELECT MIN(column_name)
FROM table_name
WHERE condition;
SELECT MAX(column_name)
FROM table_name
WHERE condition;
The COUNT() function returns the number of rows that matches a specified
criterion.
SELECT COUNT(column_name)
FROM table_name
WHERE condition;
SELECT AVG(column_name)
FROM table_name
WHERE condition;
SELECT SUM(column_name)
FROM table_name
WHERE condition;
The ALTER TABLE statement is also used to add and drop various constraints on
an existing table.
A stored procedure is a prepared SQL code that you can save, so the code can
be reused over and over again.
CREATE PROCEDURE procedure_name
AS
sql_statement
GO;
EXEC procedure_name;
CHECK ( [ condition ] );
[before | after]
on [table_name]
[trigger_body]