what is Constraint? How many types of constraints in SQL ?

Answer Posted / shreevats

Constraints are the conditions which allows to restrict the invalid or inconsistent data in the tables.

Types of Constraints
1.Not null:Not null make any column as mandatory and it will not allows the null values.
2.Unique:It will not allows duplicate values.
3.Primary Key:A PK is used to identify a record uniquely in a table.
PK=UNIQUE+NOT NULL
4.Foreign Key or Referential Integrity constraint
:It creates the relationship between any two tables.
5.Check: It is used for enforcing business validation.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What number sorts of privileges are accessible in sql?

748


What are a scheduled jobs or what is a scheduled tasks?

655


How will you go about resolving deadlocks?

700


Is it possible to replicate data from sql server to oracle? : sql server replication

746


How to define and use table alias names in ms sql server?

746






Explain different types of collation sensitivity?

701


What is precedence constraint?

717


Why do you need a sql server?

689


What is cross join in sql server joins?

801


What is data source document?

755


What is difference in performance between insert top (n) into table and using top with insert?

731


What are the advantages of user defined function?

666


What is sql server replication? : sql server replication

692


What is faster join or union?

797


What are the advantages of passing name-value pairs as parameters?

834