Following are some of the important SQL Server Interview Questions and Answers
RDMBS is a software system which is used to manage the database.In RDBMS data is stored using collection of tables.Tables consists of columns and rows.
Primary key is a group of fields in a table which identifies row.Primary key values cannot be NULL.Two rows never have the same primary key value.
Unique Key is a group of fields in a table which identifies row.Difference between primary key and unique key is that unique key can have a null value.
Join is used fetch rows from multiple tables using a common column.Column defined in the first table acts as the primary key while the column defined in the other
table acts the foreign key.
Inner join return rows when both the tables have matching column values.
Right join return common rows in the tables and all rows of Right hand side table in the join.
Left join return common rows in the tables and all rows of Left hand side table in the join.
Full join returns rows from both the tables.
A view is a virtual table as it doesn’t exist physically unlike actual tables.It can consist of data from multiple tables.
We can filter and sort data when returning the view data.
Index helps in faster retrieval of data from the table.Index is like an index of a book.Like an index in a book Index is used to get to the actual row containing the data.This results in faster execution of query when selecting rows.
Clustered Index physically rearranges the data in a table.This is the reason that a table can have only one Clustered Index.
NonClustered Index does not physically rearranges the data in a table.This is the reason that a table can have multiple NonClustered Indexes.
A cursor is used to traverse the rows in a table.A cursor points to a single row at a time.So it used when we need to traverse all the rows in a table.
A query is request to the RDBMS to retrieve the matching rows for a table or group of tables.
SQL stands for Structured Query Language.It is the language supported by all the RDBMS such as Oracle and SQL Server.
A subquery is a query within another query. The outer query is called as main query, and inner query is called subquery.