Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Check Constraints
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') ); insert into Persons(id,LastName,FirstName,Age,City)values(1,'vinod','kumar',34,'sandnes'); /* Error(s), warning(s): The INSERT statement conflicted with the CHECK constraint "CHK_Person". The conflict occurred in database "rextester", table "dbo.Persons". The statement has been terminated. The check constraint for age is applied i.e age when enterd with less than 18 ,it given the above error */ select * from Persons;
run
|
edit
|
history
|
help
0
NAMES CODE
QLSV
Employye
Solution 4
lab5
Yan_1st_wall
create table with constraunt
Where, And
FIGURA5.2
BRYANActual