SQL Server Interview Questions
SQL Server Interview Questions
What is the significance of NULL value and why should we avoid permitting null
values?
Null means no entry has been made. It implies that the value is either unknown or
undefined.We should avoid permitting null values because Column with NULL values
can't have PRIMARY KEY constraints. Certain calculations can be inaccurate if NULL
columns are involved.
What is the significance of NULL value and why should we avoid permitting null
values?
Null means no entry has been made. It implies that the value is either unknown or
undefined.We should avoid permitting null values because Column with NULL values
can't have PRIMARY KEY constraints. Certain calculations can be inaccurate if NULL
columns are involved.
What is normalization?
Normalization is the basic concept used in designing a database. Its nothing but, an
advise given to the database to have minimal repetition of data, highly structured,
highly secured, easy to retrieve. In high level definition, the Process of organizing
data into tables is referred to as normalization.
What is a trigger?
What is a view?
If we have several tables in a db and we want to view only specific columns from
specific tables we can go for views. It would also suffice the needs of security some
times allowing specfic users to see only specific columns based on the permission
that we can configure on the view. Views also reduce the effort that is required for
writing queries to access specific columns every time.
What is an Index?
When queries are run against a db, an index on that db basically helps in the way the
data is sorted to process the query for faster and data retrievals are much faster
when we have an index.
There are basically two types of indexes that we use with the SQL ServerClustered -
1. It will format the entire table, inturn physically sort the table.
Non-Clustered Index
Extent Vs Page?
Pages are low level unit to store the exact data in sql server. Basically, the data will
be stored in the mdf, ldf, ndf files. Inturn, pages are logical units available in sql
server.The size of the page is 8KB.
Thus I/O level operation will be happening at pages level.The pages will hold a
template information at the start of each page (header of the page).
They are,
1. page number,
2. page type,
1. Uniform extents
2. Mixed extents
Uniform Extents:It occupied or used by a single object. Inturn, a single object will
hold the entire 8 pages.
Mixed Extents:Mulitple objects will use the same extent. SQL Server will allow a max
of eight objects to use a shared extent.
Property of SQL Server :Initally if an object is created, sql server will allocate the
object to the mixed extent and once if the size reaches 8 pages and more...
immediately, a new uniform extent will be provided for that particular object.