12.07.2015 Views

Module 13 (Introduction to SQL - Part 2).pdf

Module 13 (Introduction to SQL - Part 2).pdf

Module 13 (Introduction to SQL - Part 2).pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Northwind ExampleSELECT DISTINCTROWCategories.CategoryName,Products.ProductName,Sum(CCur([Order Details].[UnitPrice]*[Quantity]*(1-[Discount])/100)*100) AS ProductSalesFROM(Categories INNER JOIN ProductsON Categories.CategoryID = Products.CategoryID)INNER JOIN(Orders INNER JOIN [Order Details]ON Orders.OrderID = [Order Details].OrderID)ON Products.ProductID = [Order Details].ProductIDWHERE (((Orders.ShippedDate) Between #1/1/94# And #12/31/94#))GROUP BY Categories.CategoryName, Products.ProductName;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!