10.3 Implict JOIN

Display SKUs as well as their order information.

/* Inner Join (implicit) */
select *
from  retail_order, order_item
where retail_order.ordernumber = order_item.ordernumber
;
TABLE10.1: 7 records
OrderNumber StoreNumber StoreZip OrderMonth OrderYear OrderTotal OrderNumber SKU Quantity Price ExtendedPrice
3000 10 98110 January 2015 480 3000 100200 1 300 300
2000 20 02335 December 2014 310 2000 101100 4 50 200
3000 10 98110 January 2015 480 3000 101100 2 50 100
2000 20 02335 December 2014 310 2000 101200 2 50 100
3000 10 98110 January 2015 480 3000 101200 1 50 50
1000 10 98110 December 2014 445 1000 201000 1 300 300
1000 10 98110 December 2014 445 1000 202000 1 130 130
/* table nickname */
select A.ordernumber, A.orderyear, B.sku, B.extendedprice
from  retail_order A, order_item B
where A.ordernumber = B.ordernumber
;
TABLE10.2: 7 records
ordernumber orderyear sku extendedprice
3000 2015 100200 300
2000 2014 101100 200
3000 2015 101100 100
2000 2014 101200 100
3000 2015 101200 50
1000 2014 201000 300
1000 2014 202000 130