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
Which tcp/ip port does the sql server run on? How can it be changed?
What are the differences between ms sql server & oracle?
What programming language would you use to create embedded functions in ssrs?
What do you need to connect php to sql server?
Why do we need normalization?
What is candidate key with example?
How can we get count of the number of records in a table?
How to trouble shoot if unable to connect SQL Server
How to find the login name linked to a given user name?
Define indexes?
difference between Clustered index and non clustered index ?
how to invoke a trigger on demand? : Sql server database administration
Explain the difference between functions and stored procedures in sql server?
What is the difference between stored procedure and functions?
You want to implement the one-to-one relationship while designing tables. How would you do it?