MS SQL Server interview question and answer

 1).What is SQL Server?

SQL Server is a relational database management system (RDBMS) developed by Microsoft. It provides an environment to manage data and applications using SQL (Structured Query Language) commands.

2). What is a Primary Key?

A Primary Key is a unique identifier for a record in a database table. It is used to ensure that each record can be uniquely identified, and it prevents duplicates or inconsistencies in the data. A Primary Key is created using a unique index or constraint on one or more columns in the table.

3). What is a Foreign Key?

A Foreign Key is a field in a table that links to the Primary Key of another table. It is used to establish a relationship between two tables and ensure data consistency between them.

4). What is normalization?

Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity. It involves breaking down larger tables into smaller, more specialized tables, and establishing relationships between them through Foreign Keys. Normalization helps to minimize data duplication, improve query performance, and reduce the risk of data anomalies.

5).What is a Stored Procedure?

A Stored Procedure is a precompiled and stored set of SQL statements that can be executed by a database engine. It can be used to encapsulate business logic or complex queries and can be invoked from various applications or tools. Stored procedures can help to improve performance, security, and maintainability of database applications.

6).What is a Trigger?

A Trigger is a special type of Stored Procedure that is automatically executed in response to certain events, such as an INSERT, UPDATE, or DELETE operation on a table. Triggers can be used to enforce business rules, audit data changes, or perform other actions based on specific events.

7).What is an Index?

An Index is a data structure used by a database engine to improve query performance. It is created on one or more columns in a table and allows the database engine to quickly retrieve records based on the values in those columns.

8).What is a View?

A View is a virtual table that is based on the result set of a SELECT statement. It can be used to simplify complex queries, restrict access to sensitive data, or provide a customized view of the data to different users or applications.

9). What is a Join?

A Join is an operation that combines data from two or more tables based on a related column. It is used to retrieve data from multiple tables in a single query and can be performed using different types of Join operations such as INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL OUTER JOIN.

10). What is ACID?

ACID stands for Atomicity, Consistency, Isolation, and Durability. It is a set of properties that ensure reliable processing of database transactions. Atomicity ensures that a transaction is treated as a single unit of work, Consistency ensures that the database remains in a valid state before and after a transaction, Isolation ensures that concurrent transactions do not interfere with each other, and Durability ensures that the changes made by a transaction are permanent and recoverable.

11). What is a Clustered Index?

A Clustered Index is an Index that defines the physical order of data in a table based on the values of one or more columns. It is used to improve query performance by allowing the database engine to quickly retrieve records based on the order of the clustered index.

12). What is a Non-Clustered Index?

A Non-Clustered Index is an Index that does not define the physical order of data in a table. Instead, it creates a separate data structure that allows the database engine to quickly retrieve records based on the values of one or more columns.


Comments

Popular posts from this blog

Angular top most interview question ans

Earn Passive income from Honeygain App