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

Which of the following is FALSE regarding the tempdb database?

NOTE: This is objective type question, Please click question title for correct answer.
Which of the following built in tool allows you to changes services accounts and auto-start services in SQL server 2008

NOTE: This is objective type question, Please click question title for correct answer.
DBCC SHRINKDATABASE (UserDB, 10); What is the unit of second parameter?

NOTE: This is objective type question, Please click question title for correct answer.
What is compatibility level of SQL server 2012?

NOTE: This is objective type question, Please click question title for correct answer.
Which of the following files/programs are not removed by the uninstaller of SQL Server while uninstalling server?

NOTE: This is objective type question, Please click question title for correct answer.
Below query is a which type of join? Select * From employee_master,project_master;

NOTE: This is objective type question, Please click question title for correct answer.
How many ways Cross join can be written into Sql-Server?

We can write Cross Join in 2 ways in Sql-Server such as

Select * from Table1,Table2;
Select * from Table1 Cross Join Table2;
What will be the Error after executing below query? select * from employee_master,employee_master;

It will throw an error saying:-

Msg 1013, Level 16, State 1, Line 1
The objects "employee_master" and "employee_master" in the FROM clause have the same exposed names. Use correlation names to distinguish them.

So, to work above query, we have to give Alias name as below:-

Select * from employee_master A,employee_master B;
Then it will execute properly and will give us output.
What do we mean by self-join and cross-join?

1). self-join and cross-join both produces the same output.
2). self-join is applied in same table only whereas cross-join is applied in different tables.
3). in case of self-join,we have to give alias name in table but in case of cross-join, it may or may not required.

Syntax of self-join:-

select * from employee_master A,employee_master B;


Syntax of cross-join:-

select * from employee_master A,project_master B;


//or we can also write as:-

select * from employee_master,project_master;

How to get Last record in MySQL?

By using Limit clause in MySQL,we can the Last record.

For ex:-

Select employee_id from employee_master order by employee_id desc limit 1;
How many ways of getting Last records in SQL-Server?

NOTE: This is objective type question, Please click question title for correct answer.
What will be the output of below query? Select Replicate('vishal',5);

NOTE: This is objective type question, Please click question title for correct answer.
Which Data-Type is used for storing Multilingual-Languages other than English?

NOTE: This is objective type question, Please click question title for correct answer.
What is the max length of Nvarchar data-type?

NOTE: This is objective type question, Please click question title for correct answer.
Below query is which type of join in sql-server? Select * from employee_master A,employee_master B;

NOTE: This is objective type question, Please click question title for correct answer.
If cross-join is having WHERE CLAUSE,then which type of join it will be called?

NOTE: This is objective type question, Please click question title for correct answer.
If we write "Use DB_Name",then what will happen?

NOTE: This is objective type question, Please click question title for correct answer.
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