Sqlserver interview questions


Total available count: 38
Subject - Databases
Subsubject - Sqlserver

What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?

The HAVING CLAUSE is used to restrict the result set returned by the GROUP BY CLAUSE. When a programmer uses GROUP BY with the HAVING CLAUSE, the GROUP BY CLAUSE divides the rows into sets of grouped rows and aggregates their values and then the HAVING CLAUSE eliminates undesired aggregated groups.
 
The HAVING CLAUSE is basically used only with the GROUP BY function in a query whereas WHERE CLAUSE is applied to each row before they are part of the GROUP BY function in a query.



Next 5 interview question(s)

1
What is the difference between a primary key and a unique key?
2
What is the difference between UNION and UNION ALL?
3
What is Unique key constraint?
4
When is the use of UPDATE_STATISTICS command?
5
Which TCP/IP port does SQL Server run on? How can it be changed?


Comments