Java Reference
In-Depth Information
Table 3-10: Customer Table
Customer_Number First_Name MI
Last_Name Street
City
S tate
Zip
1 00
Michael
A
C orleone
1 23 Pine
N ew York
N Y
1 0006
1 01
F redo
X
C orleone
1 7 Main
N ew York
N Y
1 0007
1 02
S onny
A
C orleone
123 Walnut Newark
N J
1 2346
Table 3-11: Inventory Table
Item_Number
Name
Description
Qty
Cost
1001
Corn Flakes
Cereal
130
1.95
1002
Rice Krispies
Cereal
97
1.87
1005
Chocolate Chip
Cookies
217
1.26
1006
Fig Bar
Cookies
162
1.57
1008
Cola
Soda
144
0.61
1010
Orange Soda
Soda
84
0.71
Table 3-12: Orders Table
Order_Number
Customer_Number
Order_Date
Ship_Date
2
101
12/8/01
12/10/01
3
103
12/9/01
12/11/01
Table 3-13: Ordered Items Table
ID
Order_Number
Item_Number
Qty
5000
2
1001
2
5001
2
1004
1
5004
3
1006
4
5005
3
1009
2
One of the most powerful features of SQL is its ability to combine data from several
different tables using the JOIN statement. Using JOINS, you are able to produce a
detailed invoice showing the customer name, shipping address, and billing
information, with a detailed list of the items ordered, including description, quantity,
unit price, and extended price ( unit price * quantity ).
Using keys in a JOIN
Search WWH ::




Custom Search