What is Sql - Constraints - Web Development

What is Sql – Constraints

What is Sql – Constraints

Constraints are utilized to indicate the principles concerning information in the table. It tends to be connected for single or different fields in a SQL table during the formation of a table or in the wake of making utilizing the ALTER TABLE direction. The imperatives are:

NOT NULL – Not Null Value should be Inserted in the table.
CHECK – Verifies that all values in a field satisfy the given condition.
DEFAULT – Automatically assigns a default value if no value has been specified for the field.
UNIQUE – Ensures unique values to be inserted into the field.
INDEX – Indexes a field providing faster retrieval of Data.
PRIMARY KEY – Column Name uniquely identifies each record in a table.
FOREIGN KEY – Ensures referential integrity for a record in another table.

Leave a Reply

Your email address will not be published. Required fields are marked *