1//Sql Server
2
3//Add a table
4ALTER TABLE clients ADD Points INT DEFAULT 0
5//Edit an existing table
6ALTER TABLE clients ADD CONSTRAINT points DEFAULT 0 FOR Points
1Sets a default value for a column;
2Example 1 (MySQL): Creates a new table called Products which has a
3name column with a default value of ‘Placeholder Name’ and an available_
4from column with a default value of today’s date.
5CREATE TABLE products (
6id int,
7name varchar(255) DEFAULT 'Placeholder Name',
8available_from date DEFAULT GETDATE()
9);
10Example 2 (MySQL): The same as above, but editing an existing table.
11ALTER TABLE products
12ALTER name SET DEFAULT 'Placeholder Name',
13ALTER available_from SET DEFAULT GETDATE();