CHECK

A check constraint will prevent values outside the bounds of a check.
Lets say you want to ensure that all Prices entered into this table are greater than 10.



Applying After Creation


ALTER TABLE MyProducts 
ADD CONSTRAINT Constraint.Name CHECK (Price > 10)


Applying On Creation


CREATE TABLE MyProducts 
(
   ProductValue INTEGER CONSTRAINT constraint.name CHECK (ProductValue BETWEEN 1 AND 100)
)




© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext