Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

check constraint in sql

CREATE TABLE Persons (
    ID int NOT NULL,
    LastName varchar(255) NOT NULL,
    FirstName varchar(255),
    Age int,
    City varchar(255),
    CONSTRAINT CHK_Person CHECK (Age>=18 AND City='Sandnes')
);
 
PREVIOUS NEXT
Tagged: #check #constraint #sql
ADD COMMENT
Topic
Name
8+6 =