Wednesday, 4 July 2012

Interview Questions on SQL SERVER Part I | Interview Questions and Answers on SQL SERVER Part I

                  Hi Friends, in this article I will share some interview Questions on SQL SERVER.
I already explained some interview Questions on SQL SERVER in Interview Questions and Answers on SQL SERVER Part II
1.What is Sql server?
                SQL - Structured query language is the standard command set used to communicate with the relational database management system.
In Simply SQL SERVER is a Structured query language  for accessing databases.
SQL is an ANSI (American National Standards Institute) standard
SQL can execute queries against a database, retrieve data from a database,insert,update,delete records from database.
SQL can create new databases,new tables,stored procedures ,views in a database.
SQL can set permissions on tables, procedures, and views.
Sql server - is commonly used as the backend system for websites and can support thousands of concurrent users.SQL Server is much more robust and scalable than a desktop database management system such as Microsoft Access.
2.Define Normalisation?
                Normalization can be defined as the process of organization the data to reduce the redundant table data to the minimum. This process is carried out by dividing the database into two or more than two tables and defining relationship between them so that deletion, updating and insertion can be made to just one table and it can be propagated to other tables through defined relationships.
Normalisation is an essential part of database design. A good understanding of the semantic of data helps the designer to built efficient design using the concept of normalization.
It reduces redundancy. It is done to improve performance of query.
3.What is the difference between TRUNCATE and DELETE commands?
                TRUNCATE is a DDL command whereas DELETE is a DML command. Hence DELETE operation can be rolled back, but TRUNCATE operation cannot be rolled back. WHERE clause can be used with DELETE and not with TRUNCATE.
                  Truncate an Delete both are used to delete data from the table. These both command will only delete data of the specified table, they cannot remove the whole table data structure.Both statements delete the data from the table not the structure of the table.

TRUNCATE is a DDL (data definition language) command whereas DELETE is a DML (data manipulation language) command.

You can use WHERE clause(conditions) with DELETE but you can't use WHERE clause with TRUNCATE .

You cannot rollback data in TRUNCATE but in DELETE you can rollback data.TRUNCATE removes(delete) the record permanently.

A trigger doesn’t get fired in case of TRUNCATE whereas Triggers get fired in DELETE command.

If tables which are referenced by one or more FOREIGN KEY constraints then TRUNCATE will not work.

TRUNCATE resets the Identity counter if there is any identity column present in the table where delete not resets the identity counter.

Delete and Truncate both are logged operation.But DELETE is a logged operation on a per row basis and TRUNCATE logs the deallocation of the data pages in which the data exists.

TRUNCATE is faster than DELETE.

If you like my blog or articles, you can appreciate by leaving your comments or Liking my Facebook page Aspdotnet-kishore, following on Google+ Aspdotnet-Kishore, Twitter  on AspdotnetKishore, Linked in Aspdotnet-Kishore, stumbling my posts on stumble upon and subscribing on  RSSfeed Aspdotnet-Kishore for free updates directly to your Email inbox . Watch my blog  for more articles."

No comments:

Post a Comment

© 2012-2014 All Rights Reserved.
The content is copyrighted to Kishore and may not be reproduced on other websites without permission from the owner.