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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
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
Explain basic SQL queries with SELECT from where Order By,
Group By-Having?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Explain basic SQL queries with SELECT from where Order By, Group By-Having?
Answer
# 1
Order by clause is used to sort information of a table into 
specific order either ascending or descending order.

syntax:select stmt order by column;

ex:select * from emp order by sal;

Group by clause is used to divide entire group into 
subgroups based on the common values columns.we can use 
group by clause along with group functions.

syntax:select group by(exp 1),group by(exp 2),....from 
table name group by column name;
select max(sal),min(sal) from emp group by deptno;
Group by clause can allow where clause.


Having:is used to restrict information of the atble based 
on condition.

syntax:select group by (exp 1) ,group by (exp 2) from table 
name group by column having (condition).

Having and Group by clauses can interchange their positions.

but when using having along with order by clause having 
should be placed before order by clause.
 
Is This Answer Correct ?    11 Yes 1 No
Swapna
 
  Re: Explain basic SQL queries with SELECT from where Order By, Group By-Having?
Answer
# 2
sory i m satisfied with idea.actualy i want to know is this
query is right or not.plz inform me.

SELECT country,city
FROM customers 
GROUP BY country
ORDER BY city DESC
 
Is This Answer Correct ?    0 Yes 0 No
Nitin
 
 
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
Following are some of the question related to below mentioned query? select e1.salary from employee3 e1 where 2= ( select count(distinct(e2.salary)) from employee3 e2 where e2.salary>=e1.salary ) 1) What the query returns? 2) How it works? - Detail explanation (what the sub query does, why it is (where 2=)....etc...Please?  3
logshipping is Any difference 2000 and 2005?  1
How to find the date and time of last updated table? Teledata4
Which is best Subquery (or) joins in sql server? explain why  2
How will u get 5 years back record?  4
UPDATE statement can on a single table or on the multiple table? iGate5
What are cursors?  8
how do u do Performance tunning ? Satyam1
Difference Between varchar and nvarchar datatype? Satyam2
MULTICAST DELEGATES IN C#.NET WITH REAL TIME EXAMPLE IBM1
How will oyu test the stored procedure taking two parameters namely first name and last name returning full name?  3
What is the basic difference between clustered and a non-clustered index?  3
What is the purpose of using COLLATE in a query?  1
is there more the two primary key in a single table? Systematix22
select the 3rd maximum salary from sql server database if 4 (just an example In practically I may not know the exact situation) of the highest salaries are equal.  7
What is the difference between a stored procedure and a user defined function in sql server? Millennium2
What are the types of indexes available with SQL Server?  2
in tabase table having a column in it empname field is there which having 5 duplicate values is there i want deleted all the duplicates i want showing only one name only.  7
from the table display the 2nd highest salary? and also the least 2nd salay?  6
Can you link only other SQL Servers or any database servers such as Oracle?  1
 
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