SQL DEFAULT


The DEFAULT constraint provides a default value to a column when the INSERT INTO statement does not provide a specific value.

Example

CREATE TABLE CUSTOMERS(
       id  INT              NOT NULL,
       name VARCHAR (20)     NOT NULL,
       salary   DECIMAL (18, 2) DEFAULT 5000.00,       
       PRIMARY KEY (id)
)

Share this article on