Top 100 sql server queries interview questions

Introduction

In this article, you will find basic to most puzzled interview queries questions with an example. This article is very useful for those who are preparing for an interview in IT company. Whether you are experienced or fresher, this article will cover all Microsoft SQL Server query questions from basic to advanced level.


SQL Server Advanced Questions - 'Small Tricky SQL SERVER Queries'


85) What would be the output of following query?
1
select 15

a. 15
b. 1
c. 0
d. Could not find


86) What would be the output of following query?
1
select $

a. Could not find
b. 1
c. $
d. 0.00

87) What would be the output of following query?
1
select 1 + '1'

a. 11
b. 1
c. 2
d. Could not find


88) What would be the output of following query?
1
select '1' + 1

a. 11
b. 1
c. 2
d. Could not find


89) What would be the output of following query?
1
select count('7')

a. 0
b. 1
c. 7
d. Could not find


90) What would be the output of following query?
1
select count(*)

a. 0
b. 1
c. 7
d. Could not find


91) What would be the output of following query?
1
select 'TechStudy' + 1

a. 'TechStudy'
b. TechStudy
c. TechStudy1
d. Conversion failed


92) What would be the output of following query?
1
select (SELECT 'TechStudy')

a. 'TechStudy'
b. TechStudy
c. TechStudy1
d. Could not find


93) What would be the output of following query?
1
select 'TechStudy' + '1'

a. 'TechStudy'
b. TechStudy
c. TechStudy1
d. Could not find


94) What would be the output of following query?
1
select * from 'City'

a. City
b. None
c. Select all data from city table
d. Incorrect syntax


95) What would be the output of following query?
1
select * from City, Student

a. Output will be inner join
b. Output will be only City table details
c. Output will cross join of both tables details
d. Could not find


96) What would be the output of following query?
1
select 'David' from student

a. Display David as many rows in student table
b. None
c. Display on time David
d. Could not find


97) What would be the output of following query?
1
select SUM(null)

a. 0
b. None
c. NULL
d. Operand data type void type is invalid for sum operator.


98) What would be the output of following query?
1
select 0/9

a. 0
b. Throw error(Divide by zero error encountered.)
c. NULL
d. 1


99) What would be the output of following query?
1
select 1 where null = null

a. 0
b. Nothing will return
c. NULL
d. 1


« 1 2 3 4 5 6 »  

Responses




Popular Posts

Facebook

Founded in 2016, Tech Study passionately delivers stylish and dynamic innovative information to programmer and technology lovers. http://www.techstudy.org/.