Quantcast
Channel: CodeSection,代码区,SQL Server(mssql)数据库 技术分享 - CodeSec
Viewing all articles
Browse latest Browse all 3160

SQL Server Interview Questions and Answers

$
0
0
Following are some of the importantSQL Server Interview Questions and Answers RDBMS

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

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

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

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

Inner join return rows when both the tables have matching column values.

Right Join

Right join return common rows in the tables and all rows of Right hand side table in the join.

Left Join

Left join return common rows in the tables and all rows of Left hand side table in the join.

Full Join

Full join returns rows from both the tables.

View

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

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 rowcontaining the data.This results in faster execution of query when selecting rows.

Clustered Index

Clustered Index physically rearranges the data in a table.This is the reason that a table can have only one Clustered Index.

Non-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.

Cursor

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.

Query

A query is request to the RDBMS to retrieve the matching rows for a table or group of tables.

SQL

SQL stands for Structured Query Language.It is the language supported by all the RDBMS such as Oracle and SQL Server.

Sub Query

A subquery is a query within another query. The outer query is called as main query, and inner query is called subquery.


Viewing all articles
Browse latest Browse all 3160

Trending Articles