SQL DEFAULT Constraint
- The DEFAULT constraint is used to insert a default value into a column.
- The default value will be added to all new records, if no other value is specified.
My SQL / SQL Server / Oracle / MS Access-
CREATE TABLE Persons ( P_Id int NOT NULL, LastName varchar(255) NOT NULL, FirstName varchar(255), Address varchar(255), City varchar(255) DEFAULT 'Sandnes' )
Note: SQL creates a DEFAULT constraint on the “City” column when the “Persons” table is created.
Learn how to use SQL to store, query, and manipulate data. SQL is a special-purpose programming language designed for managing data in a relational database, and is used by a huge number of apps and organizations.
- Lectures 41
- Quizzes 0
- Duration 50 hours
- Skill level All levels
- Language English
- Students 0
- Certificate No
- Assessments Self