From ff802c3f757c7b4b7f3c05598316616dbe11f9f0 Mon Sep 17 00:00:00 2001 From: GowthamRaj K <43011442+gowthamrajk@users.noreply.github.com> Date: Tue, 27 Jul 2021 19:23:51 +0530 Subject: [PATCH] Update README.md --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index e0dbd98..a5e9d94 100644 --- a/README.md +++ b/README.md @@ -154,3 +154,33 @@ These components are − - A field with a NULL value is the one that has been left blank during a record creation. # SQL Constraints 🚩 + +- Constraints are the rules enforced on data columns on a table. +- These are used to limit the type of data that can go into a table. +- This ensures the accuracy and reliability of the data in the database. +- Constraints can either be column level or table level. +- Column level constraints are applied only to one column whereas, table level constraints are applied to the entire table. + +Following are some of the most commonly used constraints available in SQL − + +### NOT NULL Constraint +− Ensures that a column cannot have a NULL value. + +### DEFAULT Constraint +− Provides a default value for a column when none is specified. + +### UNIQUE Constraint +− Ensures that all the values in a column are different. + +### PRIMARY Key +− Uniquely identifies each row/record in a database table. + +### FOREIGN Key +− Uniquely identifies a row/record in any another database table. + +### CHECK Constraint +− The CHECK constraint ensures that all values in a column satisfy certain conditions. + +### INDEX +− Used to create and retrieve data from the database very quickly. +