SQL Constraints
SQL Constraints are used to give some rules for the columns of a table. we can create and define constraints on one or more column of table. This maintains the data integrity of the table.
Constraints can be divided into two parts :-
1. Column Level Constraints :- It is apply to only column.
2. Table Level Constraints :- It is apply to whole table.
Syntax : -
CREATE TABLE table_name
(
column1 datatype constraints,
column1 datatype constraints,
- - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
columnN datatype constraints
);
0 Comments