3
Reply

What is an integrity constraint in SQL? Give the command for it?

Puran Mehra

Puran Mehra

14y
5.7k
0
Reply

    Integrity Constraints are rules and restrictions applied on column or a table such that unwanted data can't insert into tables. This ensures the accuracy and reliability of the data in the database. we can create constraints on single or multiple columns of any table. Constraints maintain the data integrity and accuracy in the table. Constraints can classify into two types. Column Types Constraints Definitions of these types of constraints is given at time of table creation. Create Table My_Constraint ( IID int NOT NULL, Salary int CHECK(Salary>5000) )Table Types Constraints Definitions of these types constraints is given after creation of table using Alter Command.Alter Table My_Cosntraint Add constraint Check_Constraint Check(Age>50)Sql Server contain 6 types of Constraint 1. Not Null Constraint 2. Check Constraint 3. Default Constraint 4. Unique Constraint 5. Primary Constraint 6. Foreign Constraint

    Integrity Constraints are used to apply business rules for the database tables.The constraints available in SQL are Foreign Key, Not Null, Unique, Check.Constraints can be defined in two ways 1) The constraints can be specified immediately after the column definition. This is called column-level definition. 2) The constraints can be specified after all the columns are defined. This is called table-level definition.For more please visit: http://beginner-sql-tutorial.com/sql-integrity-constraints.htm

    What is an integrity constraint in SQL? Give the command for it?