First page Back Continue Last page Image

Building a Database – Customers

salestransaction

stxid

int(5)

PK

Not Null

productid

int(5)

FK

Not Null

customerid

int(5)

FK

Not Null

employeeid

int(5)

FK

Null

saledate

  • date

Not Null

saleamount

  • ()

Not Null

product

prdid

int(5)

PK

Not Null

prdname

vc()

.

Not Null

prddesc

vc()

.

Null

prdinventory

int(5)

.

Null

prcost

dec()

Null

customer

customerid

int(5)

PK

Not Null

custnumber

int(5)

Not Null

custfname

vc()

Null

custmname

vc()

Null

custlname

vc()

Null

custstreet

int(5)

PK

Not Null

custcity

int(5)

Not Null

custstate

vc()

Null

custzip

vc()

Null

custphone

vc()

Null

custemail

vc()

Null

Now let’s Add the Customers to the Mix

Customers are a good place to consider L1 Normalization

The Configuration of the Customer table to the right is what many of you will want to do, in fact you will find databases out there now done this way

You need to apply the

“There can be only one” rule

This Approach is wrong!!