SHASHANGKA SHEKHAR'S BLOG

MVP, Author

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

Hits: 29

Specifies a search condition for a group or an aggregate.

  1. HAVING can be used only with the SELECT statement.
  2. HAVING is typically used in a GROUP BY clause. When GROUP BY is not used, HAVING behaves like a WHERE clause.
  3. Having Clause is basically used only with the GROUP BY function in a query.
  4. WHERE Clause is applied to each row before they are part of the GROUP BY function in a query.
  5. HAVING criteria is applied after the the grouping of rows has occurred.

What types of Joins are possible with Sql Server?

Hits: 25

Joins are used in queries to explain how different tables are related. Joins also let you select data from a table depending upon data from another table.
Types of joins: INNER JOINs, OUTER JOINs, CROSS JOINs. OUTER JOINs are further classified as LEFT OUTER JOINS, RIGHT OUTER JOINS and FULL OUTER JOINS.

Difference between Function and Stored Procedure?

Hits: 31

User-Defined Functions(UDF) can be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section

where as Stored procedures cannot be.
UDFs that return tables can be treated as another rowset. This can be used in JOINs with other tables.
Inline UDF’s can be though of as views that take parameters and can be used in JOINs and other Rowset operations.

What is a NOLOCK?

Hits: 37

Using the NOLOCK query optimiser hint is generally considered good practice in order to improve concurrency on a busy system. When the NOLOCK hint is included in a SELECT statement, no locks are taken when data is read. Read More

Pages:1...24252627282930...36