Skip to content

Commit

Permalink
Sample Files
Browse files Browse the repository at this point in the history
  • Loading branch information
DJSteele committed Oct 6, 2016
1 parent f5fdb59 commit 9ce49a9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 24 deletions.
15 changes: 9 additions & 6 deletions IBM DB2/Chapter 01/Listing 1.001.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@

SET SCHEMA Item02Example;

SELECT ST.SalesID, C.CustFirstName, C.CustLastName, C.Address, C.City, C.Phone,
ST.PurchaseDate, M.ModelYear, M.Model, E.SalesPerson
FROM SalesTransactions ST, Employees E, Customers C, AutomobileModels M
WHERE C.CustomerID = ST.CustomerID
AND M.ModelID = ST.ModelID
AND E.EmployeeID = ST.SalesPersonID;
SELECT st.SalesID, c.CustFirstName, c.CustLastName, c.Address, c.City, c.Phone,
st.PurchaseDate, m.ModelYear, m.Model, e.SalesPerson
FROM SalesTransactions AS st
INNER JOIN Customers AS c
ON c.CustomerID = st.CustomerID
INNER JOIN Employees AS e
ON e.EmployeeID = st.SalesPersonID
INNER JOIN AutomobileModels AS m
ON m.ModelID = st.ModelID;
15 changes: 9 additions & 6 deletions Microsoft SQL Server/Chapter 01/Listing 1.001.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
USE Item02Example;
GO

SELECT ST.SalesID, C.CustFirstName, C.CustLastName, C.Address, C.City, C.Phone,
ST.PurchaseDate, M.ModelYear, M.Model, E.SalesPerson
FROM SalesTransactions ST, Employees E, Customers C, AutomobileModels M
WHERE C.CustomerID = ST.CustomerID
AND M.ModelID = ST.ModelID
AND E.EmployeeID = ST.SalesPersonID;
SELECT st.SalesID, c.CustFirstName, c.CustLastName, c.Address, c.City, c.Phone,
st.PurchaseDate, m.ModelYear, m.Model, e.SalesPerson
FROM SalesTransactions st
INNER JOIN Customers c
ON c.CustomerID = st.CustomerID
INNER JOIN Employees e
ON e.EmployeeID = st.SalesPersonID
INNER JOIN AutomobileModels m
ON m.ModelID = st.ModelID;
16 changes: 10 additions & 6 deletions Oracle/Chapter 01/Listing 1.001.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@

ALTER SESSION SET CURRENT_SCHEMA = Item02Example;

SELECT ST.SalesID, C.CustFirstName, C.CustLastName, C.Address, C.City, C.Phone,
ST.PurchaseDate, M.ModelYear, M.Model, E.SalesPerson
FROM SalesTransactions ST, Employees E, Customers C, AutomobileModels M
WHERE C.CustomerID = ST.CustomerID
AND M.ModelID = ST.ModelID
AND E.EmployeeID = ST.SalesPersonID;
SELECT st.SalesID, c.CustFirstName, c.CustLastName, c.Address, c.City, c.Phone,
st.PurchaseDate, m.ModelYear, m.Model, e.SalesPerson
FROM SalesTransactions st
INNER JOIN Customers c
ON c.CustomerID = st.CustomerID
INNER JOIN Employees e
ON e.EmployeeID = st.SalesPersonID
INNER JOIN AutomobileModels m
ON m.ModelID = st.ModelID;

16 changes: 10 additions & 6 deletions PostgreSQL/Chapter 01/Listing 1.001.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@

SET search_path = Item02Example;

SELECT ST.SalesID, C.CustFirstName, C.CustLastName, C.Address, C.City, C.Phone,
ST.PurchaseDate, M.ModelYear, M.Model, E.SalesPerson
FROM SalesTransactions AS ST, Employees AS E, Customers AS C, AutomobileModels AS M
WHERE C.CustomerID = ST.CustomerID
AND M.ModelID = ST.ModelID
AND E.EmployeeID = ST.SalesPersonID;
SELECT st.SalesID, c.CustFirstName, c.CustLastName, c.Address,
c.City, c.Phone, st.PurchaseDate, m.ModelYear, m.Model,
e.SalesPerson
FROM SalesTransactions AS st
INNER JOIN Customers AS c
ON c.CustomerID = st.CustomerID
INNER JOIN Employees AS e
ON e.EmployeeID = st.SalesPersonID
INNER JOIN AutomobileModels AS m
ON m.ModelID = st.ModelID;

0 comments on commit 9ce49a9

Please sign in to comment.