SQL Server allows you to use programming constructs in the batches for conditional execution of statements. For example, you need to retrieve data based on a condition. If the condition is not satisfied, a message should be displ...
Monday, September 22, 2014
Saturday, September 20, 2014
Implementing Batches in SQL Server and Guidelines
As a database developer, you might need to execute more than one SQL statement to perform a task. For example, when a new employee joins AdventureWorks, Inc., you need to insert the employee details in the database. The details o...
Wednesday, June 4, 2014
How to Create Index using sql Query: Sql Server
Database programmer should create indexes on the most frequently queried column in a table. However, at times, you might need to create an index based on a combination of one or more columns. An index based on one or more columns...
Tuesday, February 18, 2014
How to use Correlated Subqueries in SQL Programming
In SQL programming, a correlated subquery can be defined as a query that depends on the outer query for its evaluation. In a correlated subquery, the WHERE clause references a table in the FROM clause. This means that the inner q...
Thursday, February 13, 2014
How to use Nested Subqueries in SQL Programming
A subquery can contain one or more subqueries. Subqueries are used when the condition of a query is dependent on the result of another query, which in turn is dependent on the result of another subquery.
Consider an example. You...
How to use Aggregate Functions in SubQuery with Database
While using subqueries, you can also use aggregate functions in the subqueries to generate aggregated values from the inner query. For example, in a manufacturing organization, the management wants to view the sale records of all...