What is Stored Procedure?

What is Views in sql server?

Difference between a User Defined Function and a Stored Procedure

Difference between a primary key and a unique key?

What is a join and explain different types of joins.

Difference between temp table and table variable

Difference between Triggers and Stored Procedures

Difference between UNION ALL Statement and UNION

What is COALESCE / Why do we use COALESCE?

Why we use SET ROWCOUNT in Sql

How many clustered index can have a table

How many types of local tables in SQL SERVER

Difference between DELETE and TRUNCATE

What is Aggregate Functions?

What is Row_Number()?

What are Ranking Functions?

What is NOLOCK?

What is CTE?

What are the Advantages of using CTE?

What is the STUFF function and how does it differ from the
REPLACE function?

What are the difference between clustered and a non-clustered index?

What are the different index configurations a table can have?

Difference between a HAVING CLAUSE and a WHERE CLAUSE?

Difference between SET and SELECT

Provide all the built in string function of SQL SERVER

Difference between char and varchar data types

Define candidate key, alternate key, composite key.

What are constraints? Explain different types of constraints.

What is a self join? Explain it with an example.


How will you convert table row to a column comma separated value

Answers were Sorted based on User's Feedback



What is Stored Procedure? What is Views in sql server? Difference between a User Defined Funct..

Answer / aejaz ahmad

What is Stored Procedure?

Stored procedures are precompiled database queries that
improve the security, efficiency and usability of database
client/server applications. Developers specify a stored
procedure in terms of input and output variables.All of the
major database platforms, including Oracle, SQL Server and
MySQL support stored procedures

What is Views in sql server?

A view is a virtual table that consists of columns from one
or more tables. Though it is similar to a table, it is
stored in the database. It is a query stored as an object

Is This Answer Correct ?    22 Yes 1 No

What is Stored Procedure? What is Views in sql server? Difference between a User Defined Funct..

Answer / aejaz ahmad

Q-Difference between a User Defined Function and a Stored
Procedure
Ans
1:
the store procedure can not be execute with the select
command while function execute
with the select command you can execute the store procedure
with the execute statment
2:
you can not apply the crud operation on the function while
this my be apply on sql
3:
UDFs that return tables can be treated as another rowset.
This can be used in JOINs with other tables.


Q-Difference between a primary key and a unique key?
Ans- Primary Key: A column in a table whose values
uniquely identify the rows in the table.
A primary key value cannot be NULL.
Unique Key: Unique Keys are used to uniquely
identify each row in an Oracle table.
There can be one and only one row for each unique
key value

Q- What is a join and explain different types of joins.
Ans A join combines records from two or more tables in
a relational database.
In the SQL there are two types of joins: "inner"
and "outer". Outer joins are subdivided further into left
outer joins,
right outer joins, and full outer joins.
Inner join
This is the default join method if nothing else is
specified. An inner join essentially finds the intersection
between the two tables.This find and matching all
records from table A and table B.
Left outer join
A left outer join is very different from an inner
join. Instead of limiting results to those in both tables,
it limits results to those in the "left" table (A).
Right outer join
A right outer join is much like a left outer join,
except that the tables are reversed.
Every record from the right side, B, will be
returned.
Full outer join
Full outer joins are the combination of left and
right outer joins.
These joins will show records from both tables, and
fill in NULLs for missing matches on either side.

Q-Difference between temp table and table variable
Ans 1: A temp tablecan have indexws,where as a table
variable can onlyhave a primary index .
2: table variable can be faster than temp table .
3: Need to search the record so, temp table is
batter.
4: Table variables are Transaction neutral. They
are variables and thus aren't bound to a transaction.
Temp tables behave same as normal tables and
are bound by transactions.


Q-Difference between Triggers and Stored Procedures

Ans 1: Triggers are automatically fired ,but Procedure
has to be explicitly fired.
2: Triggers can only be implemented on tables or
views
SP in independent code that can be specific to
database
3: Triggers will get execute automatically when an
update ,insert or delete statement is issued aganist a
table or view

Is This Answer Correct ?    15 Yes 0 No

What is Stored Procedure? What is Views in sql server? Difference between a User Defined Funct..

Answer / murali

Difference between UNION ALL Statement and UNION

UNION ALL allows duplicate values
UNION gives distinct values

Is This Answer Correct ?    7 Yes 0 No

What is Stored Procedure? What is Views in sql server? Difference between a User Defined Funct..

Answer / jasmeet kaur

What is Views in sql server?
a view is a virtual table,which provides access to a subset of column from one or more table.a view can derive its data from one tables. an output of a query can be stored as a view. view act like a table but it does not physically take any space.view is good way to present data in a particular users from accessing the table directly.

Difference between DELETE and TRUNCATE

delete command
1.DML command
2.can be rollback
3.where clause use
4.slower than truncate
5.trigger can not be fired
6.delete all or selected rows
7.return the number of rows

TRUNCATE command
1.DDL command
2.can not be rollback
3.where clause not use
4.faster than delete
5.trigger can be fired
6.delete all rows
7.does not return the number of rows

What is Stored Procedure?
It is precompiled object stored in the database. It can invoke DDL and DML statement and can return value.

Difference between a HAVING CLAUSE and a WHERE CLAUSE?

where clause="where" is a kind of restriction statement . we use where clause to restrict all data from database. where clause is using before result retrieving.
having clause=having clause is using after retrieving the data. having clause is a kind of filtering command.

What are constraints?
a constraints allows you to apply simple referential checks to a table.

Is This Answer Correct ?    4 Yes 1 No

Post New Answer

More SQL Server Interview Questions

How to define the name and server for a new dsn?

0 Answers  


What is the New in SQL server 2008?

0 Answers  


What are the new data types are introduced in sql 2000?

0 Answers  


Can a trigger be created on a view?

0 Answers  


Why are views required in the sql server or in any other database?

0 Answers  






syntax and example for bitmap index in sql???

1 Answers  


What is the difference between referencing and joining?

1 Answers  


What is RAID and what are different types of RAID configurations?

8 Answers   Wipro,


What is transactional replication?

0 Answers  


To find second largest salary in Employee table

17 Answers   CSS,


SQL Server Architecture ?

0 Answers   IBM, Sapient,


Explain microsoft sql server functions?

0 Answers  


Categories