Check Constraint in MySQL (1 Viewer)

RajaGautam

Registered User.
Local time
Tomorrow, 01:12
Joined
Apr 5, 2013
Messages
10
Hi! everyone i have check constraint example like this:

create table persons
(
P_Id int not null,
LastName varchar(255) not null,
FirstName varchar(255),
Address varchar(255),
City varchar(255),
CHECK (P_Id>0)
);

The above example run successfully but it allow me to input P_Id to 0 which is against the condition. Why it is happening? I take this example from w3school.
 

Users who are viewing this thread

Top Bottom