Sql Server Interview Questions and Answers (1758) - Page 27

What is the use of UPDATE_STATISTICS command ?

UPDATE_STATISTICS updates the indexes on the tables accordingly.
If there occurs any large amount of modifications such as, large amount of deletions,modifications or Bulk copy into the tables has occurred,then this command has to update the indexes to take these changes into account.
What is SQL Profiler ?

SQL Profiler is a graphical tool that allows system administrators to monitor events in an instance of Microsoft SQL Server.
You can capture and save data about each event to a file or SQL Server table to analyze later.
You can use SQL Profiler to monitor only the events in which you are interested.
For example, you can monitor a production environment to see which stored procedures are hampering performances by executing too slowly.
What is SQL Server Agent ?

It plays an important role in the tasks of Database Administrator(DBA).
Its purpose is to ease the implementation of tasks for the DBA.
Using its full- function scheduling engine, you can schedule your own jobs and scripts.
Give 3 ways to get an accurate count of the number of records in a table ?

The 3 ways to get an accurate count of the number of records in a table are as below:

1) SELECT * FROM table1

2) SELECT COUNT(*) FROM table1

3) SELECT rows FROM sysindexes WHERE id = OBJECT_ID(table1) AND indid < 2
How many XML indexes possible in Sql Server?

NOTE: This is objective type question, Please click question title for correct answer.
What is join? How many types of joins?

Joins are used to extract data from multiples tables on specified some conditions.

Joins are INNER JOIN, LEFT OUTER JOIN, RIGHT OUTER JOIN, SELF JOIN.

INNER JOIN: extract only matched data from two tables.

LEFT OUTER JOIN: extract all data from left table and matched data from right table, having null against unmatched records.

RIGHT OUTER JOIN: extract all data from right table and matched data from left table, having null against unmatched records.

SELF JOIN: exctract data from one table by creating two alias of a table on specified some condition.

Even there are more joins like cross join, non-equi joins but they are in less use.

For beginners link: http://www.w3schools.com/sql/sql_join.asp
Difference between procedure and user defined function.

1) A procedure is a precompiled and function is not pre-compiled.
2) procedure may or may not return a value where as function must return a value.
3) procedure can return multiple values and function can not return multiple values.
4) you can use function in select, where or in case statement but procedures can not be used.
5) function can not call procedures inside it.
What is linked server?

One sql server is added to another sql server, this concept is called linked server. Linked server is used to extract query from different sql server.

Example:
select tab1.* from dbserver1.db1.dbo.table1 tab1, 

dbserver1.db2.dbo.table2 tab2
where tab1.id=tab2.id

What is view?

View is like a table. It does not exist in physical memory. It can be called as a subset of tables. View can be applied more than one table also.Using view, you can update/delete in table on which view is created.
Which SQL statement is used to extract data from a database?

NOTE: This is objective type question, Please click question title for correct answer.
Is NULL value treated as a blank or 0.????

NO Null is NOT Treated as Zero.
Because,NULL is not the number zero and also Null is not the empty string value.
So,A NULL value is treated as a blank
Columns per foreign key in SQL Server 2000

NOTE: This is objective type question, Please click question title for correct answer.
How many Nested Queries possible in sql?

NOTE: This is objective type question, Please click question title for correct answer.
Maximun Bytes per GROUP BY numbers SQL Server

NOTE: This is objective type question, Please click question title for correct answer.
Maximun Bytes per ORDER BY in Sql?

NOTE: This is objective type question, Please click question title for correct answer.
What is the Database size of SQL Server Database Engine object?

NOTE: This is objective type question, Please click question title for correct answer.
How Many User connections Possible in SQL Server Database Engine object?

NOTE: This is objective type question, Please click question title for correct answer.
What is the syntax to create a table?

create table tabName 

(column1 number(5) primary key,
column2 varchar2,
column3 varchar2 default = 'Value');

What is syntax to execute a stored procedure?

using following syntax...

Example: There is a stored procedure named "sp_name" and having two input parameters of string type.

Execute sp_name 'param1', 'param2';

Syantax to create a stored procedure.

Create a stored procedure using following lines of code.

Create or Replace Procedure sp_proc_name

(param1 varchar2(20), param2 varchar2(20))
as
begin
select * from tableName
end;

Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories