What will be the output of

declare @t table(name varchar(50),subject varchar(50))
insert into @t
select 'Rajlaxmi','Physics' union all
select 'Rajlaxmi','Chemistry' union all
select 'Rajlaxmi','Maths' union all
select 'Niladri','Physics' union all
select 'Niladri','Stats' union all
select 'Niladri','Maths' union all
select 'Arina','Physics' union all
select 'Arina','Chemistry' union all
select 'Arina','Maths' union all
select 'RNA','Physics' union all
select 'RNA','Chemistry' union all
select 'RNA','Stata'

select name from @t
where subject ='Maths' or subject ='Physics' or subject ='Chemistry'
group by name
having (COUNT(name)>2)

 Posted by Rajnilari2015 on 1/24/2016 | Category: Sql Server Interview questions | Views: 392 | Points: 40
Select from following answers:
  1. Arina Rajlaxmi
  2. Arina Rajlaxmi Niladri
  3. Arina Rajlaxmi Niladri RNA
  4. Niladri Rajlaxmi
  5. All Above

Show Correct Answer


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response