Interview Questions Part-3 | What is an Index in SQL Server | What is the Difference between Clustered and a Non-clustered Index in SQL Server | What is Collation | What are Primary Keys and Foreign Keys in SQL Server | What’s the Difference between a Primary Key and a Unique Key in SQL Server
By: Suresh Dasari Oct 5, 2011
Categories: Interview Questions
What is an Index in SQL Server?
An index is a physical structure containing pointers to the data. Indexes are created in an existing table to locate the data more efficiently and quickly (Read more Here)
What is the Difference between Clustered and a Non-clustered Index in SQL Server?
The difference is that, Clustered index is unique for any given table and we can have only one clustered index on a table. The leaf level of a clustered index is the actual data and the data is resorted in case of clustered index. Whereas in case of non-clustered index the leaf level is actually a pointer to the data in rows so we can have as many non-clustered indexes as we can on the db. (Read more Here)
What is Collation?
Collation refers to a set of rules that determine how the data is sorted and compared (Read more Here)
What are Primary Keys and Foreign Keys in SQL Server?
Primary key is used to identify records in table uniquely and it won’t allow null values and duplication of data. Only one primary key is allowed for each table ()
Foreign key in one table points to primary key in another table. Foreign key is used to prevent the actions that would destroy the link between two tables.
What’s the Difference between a Primary Key and a Unique Key?
Primary key is used to identify records in table uniquely and it won’t allow null values and duplication of data. Only one primary key is allowed for each table.
Unique key is same as primary key only the difference is unique key allow null values. (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
- Interview Questions in ASP.NET,C#.NET,SQL Server,.NET Framework
- 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
- jQuery 360 Degrees Image Display Plugins Examples with Tutorial
- 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
- Simple login form example in asp.net Check Username and Password availability in database
- Asp.net WebService or Creating and Consuming WebService in asp.net or Create and call webservice in asp.net or how to create webservice and how to use webservice in asp.net
- Ajax ModalPopUpExtender Example to edit the gridview row values in asp.net