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
SQL_Joins_Intersect_Except_Union
my sql2
Task_7_Final
Employye
Fff
Pivot and Unpivot
New
create table employees as e. No, e. Name., e. Phone no, e. Salary
Lab 4
SQL5