The Works of Joe Schuman
Web Development

SQL Server examples


All examples shown below use SQL Management Studio 2012.


Example 1: Counting Distinct orders with two joining tables:

Counting orders with two joining tables

Example 2: Counting orders from two joining tables with ROLLUP:

Counting orders from two tables with ROLLUP

Example 3: Selecting Customer orders from the month of August:

Selecting Customer order for August

Example 4: Selecting Company names that are not empty and has not ordered between 80 and 355 days in a year:

Selecting company names that are not empty and no orders between 80 and 365 days

Example 5: Creating a business letter:


Example 6: Creating stored procedures:


Example 7: Creating XML database:


Example 8: Creating stored procedure and executing the procedure:

Creating stored procedures and executing them