1.6. Table Contents

An alphabetical list of tables, variables, and attributes for each table is displayed below.

Customers CONTENTS Output
-----Alphabetic List of Variables and Attributes-----
VariableTypeLenPosLabel
custcityChar2025Customer’s Home City
custnameChar250Customer Name
custnumNum345Customer Number

Inventory CONTENTS Output
-----Alphabetic List of Variables and Attributes-----
VariableTypeLenPosFormatInformatLabel
invencstNum610DOLLAR10.2 Inventory Cost
invenqtyNum37  Inventory Quantity
manunumNum316  Manufacturer Number
orddateNum40MMDDYY10.MMDDYY10Date Inventory Last Ordered
prodnumNum34  Product Number

Invoice CONTENTS Output
-----Alphabetic List of Variables and Attributes-----
VariableTypeLenPosFormatLabel
custnumNum36 Customer Number
invnumNum30 Invoice Number
invpriceNum512DOLLAR12.2Invoice Unit Price
invqtyNum39 Invoice Quantity - Units Sold
manunumNum33 Manufacturer Number
prodnumNum317 Product Number

Manufacturers CONTENTS Output
-----Alphabetic List of Variables and Attributes-----
VariableTypeLenPosLabel
manucityChar2025Manufacturer City
manunameChar250Manufacturer Name
manunumNum347Manufacturer Number
manustatChar245Manufacturer State

Products CONTENTS Output
-----Alphabetic List of Variables and Attributes-----
VariableTypeLenPosFormatLabel
manunumNum340 Manufacturer Number
prodcostNum543DOLLAR9.2Product Cost
prodnameChar250 Product Name
prodnumNum348 Product Number
prodtypeChar1525 Product Type

Purchases CONTENTS Output
-----Alphabetic List of Variables and Attributes-----
VariableTypeLenPosFormat
custnumNum40 
itemChar108 
unitcostNum44DOLLAR12.2
unitsNum318 

1.6.1. The Database Structure

The logical relationship between each table and the columns common to each appear below.

1.6.2. Sample Database Tables

The six tables (named above) represent a relational database that will be illustrated in the examples in this book. These tables are small enough to follow easily, but complex enough to illustrate the power of SQL. The data contained in each table appears below.

CUSTOMERS Table
custnumcustnamecustcity
101La Mesa Computer LandLa Mesa
201Vista Tech CenterVista
301Coronado Internet ZoneCoronado
401La Jolla ComputingLa Jolla
501Alpine Technical CenterAlpine
601Oceanside Computer LandOceanside
701San Diego Byte StoreSan Diego
801Jamul Hardware & SoftwareJamul
901Del Mar Tech CenterDel Mar
1001Lakeside Software CenterLakeside
1101Bonsall Network StoreBonsall
1201Rancho Santa Fe TechRancho Santa Fe
1301Spring Valley Byte CenterSpring Valley
1401Poway CentralPoway
1501Valley Center Tech CenterValley Center
1601Fairbanks Tech USAFairbanks Ranch
1701Blossom Valley TechBlossom Valley
1801Chula Vista Networks 
N = 18  

INVENTORY Table
prodnuminvenqtyorddateinvencstmanunum
11102009/01/2000$45,000.00111
17001008/15/2000$28,000.00170
5001508/15/2000$1,000.00500
5002308/15/2000$900.00500
50031008/15/2000$2,000.00500
50042009/01/2000$1,400.00500
5001209/01/2000$1,200.00600
N = 7    

INVOICE Table
invnummanunumcustnuminvqtyinvpriceprodnum
10015002015$1,495.005001
100260013012$1,598.006001
10032101017$245.002101
10041115013$9,600.001110
10055008012$798.005002
10065009014$396.006000
10075004017$23,100.001200
N = 7     

MANUFACTURERS Table
manunummanunamemanucitymanustat
111Cupid ComputerHoustonTX
210KPL EnterprisesSan DiegoCA
600World Internet CorpMiamiFL
120Storage Devices IncSan MateoCA
500Global SoftwareSan DiegoCA
700San Diego PC PlanetSan DiegoCA
N = 6   

PRODUCTS Table
prodnumprodnamemanunumprodtypeprodcost
1110Dream Machine111Workstation$3,200.00
1200Business Machine120Workstation$3,300.00
1700Travel Laptop170Laptop$3,400.00
2101Analog Cell Phone210Phone$35.00
2102Digital Cell Phone210Phone$175.00
2200Office Phone220Phone$130.00
5001Spreadsheet Software500Software$299.00
5002Database Software500Software$399.00
5003Wordprocessor Software500Software$299.00
5004Graphics Software500Software$299.00
N=10    

PURCHASES Table
custnumitemunitsunitcost
1Chair1$179.00
1Pens12$0.89
1Paper4$6.95
1Stapler1$8.95
7Mouse Pad1$11.79
7Pens24$1.59
13Markers.$0.99
N=7   

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset