Interview Questions Part-5 | What is PRIMARY KEY Constraint in SQL Server | What is UNIQUE KEY Constraint | What is FOREIGN KEY Constraint | What is CHECK Constraint | What is NOT NULL Constraint in SQL Server ?
By: Suresh Dasari Oct 5, 2011
Categories: Interview Questions
What is PRIMARY KEY Constraint in SQL Server?
Primary key constraint is used to uniquely identify each record in database table. It won’t allow repetition or duplication of data. Each table is having only one primary key constraint and it contains only unique values. Primary key constraint doesn’t accept null values (Read more Here)
What is UNIQUE KEY Constraint in SQL Server?
Unique key constraint is same as Primary key Constraint it doesn’t allow duplication or repetition of data in column and we can uniquely identify records in table. The main difference is Primary Key constraint won’t allow null values but unique key constraint allows null values. We have a chance to define only one primary key on table but we can define many unique key constraints on table (Read more Here)
What is FOREIGN KEY Constraint in SQL Server?
A Foreign key in one table point to primary key in another table. The foreign key constraint is used to prevent the actions that would destroy the links between two tables (Read more Here)
What is CHECK Constraint in SQL Server?
The check constraint is used to limit the value range that can be placed in a column. If we set Check constraint property on particular column the values in particular column must satisfy condition set by check constraint (Read more Here)
What is NOT NULL Constraint in SQL Server?
If we set Not Null constraint property on any column in table that column won’t accept NULL or Empty values. If you want enforce any column not to accept NULL or empty value just set Not NULL Constraint property for that particular column (Read more Here)
Other Related Posts
- 3 tier architecture example in asp.net with C#
- Asp.net insert, Edit, update, delete data in gridview
- Introduction to Object Oriented Programming Concepts (OOPS) in C#.net
- jQuery 360 Degrees Image Display Plugins Examples with Tutorial
- Introduction to WCF - WCF tutorial | WCF Tutorial - Windows Communication Foundation | WCF Example | WCF Sample code in asp.net 3.5 | Basic WCF Tutorial for Beginners
- how to insert images into database and how to retrieve and bind images to gridview using asp.net (or) save and retrieve images from database using asp.net
- Interview Questions in ASP.NET,C#.NET,SQL Server,.NET Framework
- Simple login form example in asp.net Check Username and Password availability in database
- Ajax ModalPopUpExtender Example to edit the gridview row values in asp.net
- Ajax Cascading Dropdownlist Sample with database using asp.net