ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
i have table students with fields classname,studname
select * from students
classname  studname
1           xxxxx
1           yyyy
1           zzzz
2            qqqq
2             tttt
3             dsds
3             www
i want the output should be

No of students in class 1 : 3
No of students in class 2 : 2
No of students in class 3 : 2
 Question Submitted By :: Klbaiju
I also faced this Question!!     Rank Answer Posted By  
 
  Re: i have table students with fields classname,studname select * from students classname studname 1 xxxxx 1 yyyy 1 zzzz 2 qqqq 2 tttt 3 dsds 3 www i want the output should be No of students in class 1 : 3 No of students in class 2 : 2 No of students in class 3 : 2
Answer
# 1
SELECT 'No of students in class '+ CONVERT
(VARCHAR,ClassName)+' : '+CONVERT(VARCHAR, COUNT(*)) FROM 
students GROUP BY classname
 
Is This Answer Correct ?    11 Yes 0 No
Soorai Ganesh
 
  Re: i have table students with fields classname,studname select * from students classname studname 1 xxxxx 1 yyyy 1 zzzz 2 qqqq 2 tttt 3 dsds 3 www i want the output should be No of students in class 1 : 3 No of students in class 2 : 2 No of students in class 3 : 2
Answer
# 2
select classname,count(studentname) from students group by 
classname
 
Is This Answer Correct ?    0 Yes 0 No
Debasish
 
 
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
Explain the architecture of SQL Server?  2
What is the use of DBCC commands?  1
What are the two virtual tables SQL Server maintains for triggers?  2
What are the two types of concurrency?  2
Hello all, I have data like :- year amt 2004 10 2005 20 2006 30 Now i want output as:- 2004 2005 2006 10 30 60 but i have to use here group by on year.So, i need a single query within that i can find.  2
How do you load large data to the SQL server database?  2
How do you read transaction logs  1
What is the role that is required for killing a process What is the role that is required for creating a linked server IBM1
What is mean by "fill factor" ? and what is mean by "Index "in sql? Logica-CMG1
explain different types of jions with examples briefly? Zensar2
What is lock escalation?  1
What are defaults? Is there a column to which a default can't be bound?  2
Explian different types of BACKUPs avaialabe in SQL Server? Given a particular scenario, how would you go about choosing a backup plan? HCL2
hi, may i know what is the command to get abstract the current month, current year and current day from a given date.i want these three in a isolated way..seperatedly is that any way in sql server 2000  3
I have a huge amount of data which is displayed in a report. The data is viewed every day. Every day the data is displayed in 30 secs but suddenly today it is giving an timeout message today. Data has not been changed. The situation is same as yesterday. What might be the reason??? Please Answer. Satyam4
how to copy sysdatabase file from c: Drive to D: Drive in SQL Server. IBM4
How do I compare two values when one value(data type) is char and the other is an integer?  3
What is INTVAL( )and where we use Plz any body help me  1
what is physical sort data and logical sort data in index?  2
WHAT IS UNIQUE IDENTIFIER DATA TYPE? Sparsh2
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com