DISTINCT, Aliases, scalar functions and CASE, using JOIN and MERGE; Filtering and sorting data, NULL
values
Introduce data types, data type usage, converting data types, understanding SQL Server function types
Aggregate functions, GROUP BY and HAVING clauses, subqueries; self-contained, correlated, and EXISTS; Views, inline-table
valued functions, and derived tables
StoreID
------1234
570
902
1898
710
Sales.SalesOrderDetail;
Sales.SalesOrderDetail;
Sales.SalesOrderDetail;
Keyword
Expression component
SELECT
<select list>
CASE
<value to compare>
WHEN
<value to match>
THEN
<result>
END
N/A
FROM
<table source>
Join Type
Description
Cross
Inner
Outer
Starts with Cartesian product; all rows from designated table preserved,
matching rows from other table retrieved. Additional NULLs inserted as
placeholders.
FROM t1 JOIN t2
ON t1.column = t2.column
SELECT SOH.SalesOrderID,
SOH.OrderDate,
SOD.ProductID,
SOD.UnitPrice,
SOD.OrderQty
FROM Sales.SalesOrderHeader AS SOH
JOIN Sales.SalesOrderDetail AS SOD
ON SOH.SalesOrderID = SOD.SalesOrderID;
SELECT
EMP.EmpID, EMP.LastName,
EMP.JobTitle, EMP.MgrID, MGR.LastName
FROM
HR.Employees AS EMP
INNER JOIN HR.Employees AS MGR
ON EMP.MgrID = MGR.EmpID ;
SELECT
EMP.EmpID, EMP.LastName,
EMP.Title, MGR.MgrID
FROM HumanResources.Employee AS EMP
LEFT OUTER JOIN HumanResources.Employee AS MGR
ON EMP.MgrID = MGR.EmpID;
2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in
the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because
Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information
provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.