Interview Question

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.
Categories:

0 comments:

Post a Comment