SQL SERVER INTERVIEW QUESTIONS 2014- SET 6 By
"Mr.J.Venkatesan Prabu"
KAASHIV INFOTECH
[ The Asia, India & Tamil Nadu Book Of Record Holders ]
SQL Server Interview Questions 2014
- Gives you the interview tips for SQL Server
SQL SERVER INTERVIEW QUESTIONS WITH ANSWERS
1.What is the difference between a “Local Temporary
Table” and “Global Temporary Table”?
- A Local
Temporary Table is created by giving it a prefix of # whereas a Global
Temporary Table is created by giving it a prefix of ##.
- A Local
Temporary Table cannot be shared among multiple users whereas a Global
Temporary Table can be shared among multiple users.
- A Local
Temporary Table is only available to the current DB connection for the
current user and are cleared when the connection is closed whereas a
Global Temporary Table is available to any connection once created. They
are cleared when the last connection is closed.
2.What are
DMVs?
Dynamic Management
Views (DMVs), are functions that give you information on the state of
the server. DMVs, for the most part, are used to monitor the health of a
server. They really just give you a snapshot of what’s going on inside the
server. They let you monitor the health of a server instance, troubleshoot
major problems and tune the server to increase performance.
3.What are
DBCC commands?
In very basic
terms the Database Consistency
Checker (DBCC) is used to aid in server maintenance. DBCC
commands, many of which are completely undocumented, provide a set of commands
that let you perform routing maintenance, status and validation checks. The
most common DBCC commands are: DBCC CHECKALLOC (Lets you check disk
allocation); DBCC OPENTRAN (Lets you check any open transactions); and DBCC
HELP (shows a list of available DBCC commands to aid your server maintenance
processes).
4. What are the basic functions for master, msdb, model, tempdb and resource
databases?
- The master database holds
information for all databases located on the SQL Server instance and is
theglue that holds the engine together. Because SQL Server cannot start
without a functioning masterdatabase, you must administer this database
with care.
- The msdb database stores
information regarding database backups, SQL Agent information, DTS
packages, SQL Server jobs, and some replication information such as for
log shipping.
- The tempdb holds temporary objects
such as global and local temporary tables and stored procedures.
- The model is essentially a template
database used in the creation of any new user database created in the
instance.
- The resoure Database is a read-only
database that contains all the system objects that are included with SQL
Server. SQL Server system objects, such as sys.objects, are physically
persisted in the Resource database, but they logically appear in the sys
schema of every database. The Resource database does not contain user data
or user metadata.
5. What is Service Broker?
Service Broker is a message-queuing technology in SQL
Server that allows developers to integrate SQL Server fully into distributed
applications. Service Broker is feature which provides facility to SQL Server
to send an asynchronous, transactional message. it allows a database to send a
message to another database without waiting for the response, so the
application will continue to function if the remote database is temporarily
unavailable.
6. Where SQL server user names and passwords are stored
in SQL server?
They get stored in System Catalog Views
sys.server_principals and sys.sql_logins.
7. What is Policy Management?
Policy Management in SQL SERVER 2008 allows you to define
and enforce policies for configuring and managing SQL Server across the
enterprise. Policy-Based Management is configured in SQL Server Management
Studio (SSMS). Navigate to the Object Explorer and expand the Management node
and the Policy Management node; you will see the Policies, Conditions, and
Facets nodes.
8. What is Replication and Database Mirroring?
Database mirroring can be used with replication to
provide availability for the publication database. Database mirroring involves
two copies of a single database that typically reside on different computers.
At any given time, only one copy of the database is currently available to
clients which are known as the principal database. Updates made by clients to
the principal database are applied on the other copy of the database, known as
the mirror database. Mirroring involves applying the transaction log from every
insertion, update, or deletion made on the principal database onto the mirror
database.
9. What are Sparse Columns?
A sparse column is another tool used to reduce the amount
of physical storage used in a database. They are the ordinary columns that have
an optimized storage for null values. Sparse columns reduce the space
requirements for null values at the cost of more overhead to retrieve nonnull
values.
10. What does TOP Operator Do?
The TOP operator is used to specify the number of rows to
be returned by a query. The TOP operator has new addition in SQL SERVER 2008
that it accepts variables as well as literal values and can be used with
INSERT, UPDATE, and DELETES statements.
11. What is CTE?
CTE is an abbreviation Common Table Expression. A Common
Table Expression (CTE) is an expression that can be thought of as a temporary
result set which is defined within the execution of a single SQL statement. A
CTE is similar to a derived table in that it is not stored as an object and
lasts only for the duration of the query.
12. What is MERGE Statement?
MERGE is a new feature that provides an efficient way to
perform multiple DML operations. In previous versions of SQL Server, we had to
write separate statements to INSERT, UPDATE, or DELETE data based on certain
conditions, but now, using MERGE statement we can include the logic of such
data modifications in one statement that even checks when the data is matched
then just update it and when unmatched then insert it. One of the most
important advantages of MERGE statement is all the data is read and processed
only once.
13. What is Filtered Index?
Filtered Index is used to index a portion of rows in a
table that means it applies filter on INDEX which improves query performance,
reduce index maintenance costs, and reduce index storage costs compared with
full-table indexes. When we see an Index created with some where clause then
that is actually a FILTERED INDEX.
14. Which are new data types introduced in SQL SERVER
2008?
- The GEOMETRY Type: The GEOMETRY data type is a
system .NET common language runtime (CLR) data type in SQL Server. This
type represents data in a two-dimensional Euclidean coordinate system.
- The GEOGRAPHY Type: The GEOGRAPHY datatype’s
functions are the same as with GEOMETRY. The difference between the two is
that when you specify GEOGRAPHY, you are usually specifying points in
terms of latitude and longitude.
- New Date and Time Datatypes: SQL
Server 2008 introduces four new datatypes related to date and time: DATE,
TIME, DATETIMEOFFSET, and DATETIME2.
- DATE: The new DATE type just
stores the date itself. It is based on the Gregorian calendar and handles
years from 1 to 9999.
- TIME: The new TIME (n) type
stores time with a range of 00:00:00.0000000 through 23:59:59.9999999.
The precision is allowed with this type. TIME supports seconds down to
100 nanoseconds. The n in TIME (n) defines this level of fractional
second precision, from 0 to 7 digits of precision.
- The DATETIMEOFFSET Type: DATETIMEOFFSET
(n) is the time-zone-aware version of a datetime datatype. The name will
appear less odd when you consider what it really is: a date + a time + a
time-zone offset. The offset is based on how far behind or ahead you are
from Coordinated Universal Time (UTC) time.
- The DATETIME2 Type: It is an extension of the
datetime type in earlier versions of SQL Server. This new datatype has a
date range covering dates from January 1 of year 1 through December 31 of
year 9999. This is a definite improvement over the 1753 lower boundary of
the datetime datatype. DATETIME2 not only includes the larger date range,
but also has a timestamp and the same fractional precision that TIME type
provides
15. What are the Advantages of using CTE?
- Using CTE improves the readability and makes
maintenance of complex queries easy.
- The query can be divided into separate, simple,
logical building blocks which can be then used to build more complex CTEs
until final result set is generated.
- CTE can be defined in functions, stored procedures,
triggers or even views.
After a CTE is defined, it can be used as a Table
or a View and can SELECT, INSERT, UPDATE or DELETE Data.
KaaShiv InfoTech Offers Best Inpant Training in Chennai.
The training at KAASHIV INFOTECH focus on developing the technical oriented concepts that turn graduates into employable assets. Handled only by professionals from MNC companies, we know how to equip you with strong technologies fundamentals.
INPLANT TRAINING SCHEDULE FOR CSE/IT/MCA STUDENTS
Day
|
Programme
|
Day 1
|
BigData (Practical Demos)
|
Day 2
|
Windows 8 App Development (Practical Demos)
|
Day 3
|
Ethical Hacking (Facebook Hack,Server/Website Hacking(20 Attacks)
|
Day 4
|
Cloud Computing (Live Server Demo,Live Pjt Implementation)
|
Day 5
|
CCNA (-Networking-Router Configurations Practical Demo)
|
INPLANT TRAINING SCHEDULE FOR ELECTRONIC/ELECTRICAL/EIE STUDENTS
Day
|
Programme
|
Day 1
|
Embedded System (Embedded Program Designing ,Chip Burning)
|
Day 2
|
Wireless System (Device Designing,Controlling Fans with Wireless Sensors)
|
Day 3
|
CCNA (-Networking-Router Configurations Practical Demo)
|
Day 4
|
Ethical Hacking (Facebook Hack,Server/Website Hacking(20 Attacks)
|
Day 5
|
Matlab (Capture Image,Processing, Animate Images-Practical Demos)
|
| |
Mechanical/Civil Inplant training Schedule
Day
|
Programme
|
Day 1
|
Aircraft Designing
|
Day 2
|
Vehicle Movement in Airports
|
Day 3
|
3D Packaging Designs
|
Day 4
|
3D Modeling
|
Day 5
|
3D Window Shading
|
Address:
KAASHIV INFO TECH
Shivanantha Building,
X41, 5th Floor,2nd Avenue,
(Near Ayyappan Temple)
Anna Nagar, Chennai = 600040.
Contact Number : 9840678906 ,9003718877 , 9962345637 .
Visit our other websites
http://www.inplanttrainingchennai.com
http://www.inplanttraining-in-chennai.com
http://www.Kaashiveinotech.com
http://www.internshipinchennai.in
https://plus.google.com/u/0/b/110228862465265998202/dashboard/overview
https://plus.google.com/u/0/b/117408505876070870512/dashboard/overview
https://plus.google.com/u/0/b/104468163439231303834/dashboard/overview
https://plus.google.com/u/0/b/117640664472494971423/dashboard/overview
Feedback URLS
KaaShiv InfoTech Facebook Page
https://www.facebook.com/KaaShivInfoTech
Inplant Training Program in Chennai
https://www.facebook.com/pages/Inplant-Training-Program-in-Chennai/1402097696706380
Internship Training Program in Chennai
https://www.facebook.com/pages/Internship-in-Chennai-KaaShiv/1446147235603704
Facebook Inplant Training page
https://www.facebook.com/pages/Inplant-Training/256116284550327
No comments:
Post a Comment