First page Back Continue Last page Image

Building a Database – Purchase Transaction

Does this look familiar? It Should, it is very similar to the Sales Transaction we set up when we started

purchasetransaction

purchid

int(5)

PK

Not Null

partid

int(5)

FK

Not Null

invoicenbr

int(5)

Null

vendorid

int(5)

FK

Null

employeeid

int(5)

FK

Null

purchdate

date

Not Null

purchamt

dec()

Not Null

inventory

partid

int(5)

PK

Not Null

partname

vc()

Not Null

partdesc

vc()

Null

partinventory

int(5)

Null

partcost

dec()

Null

vendor

vendorid

int(5)

PK

Not Null

vendornbr

int(5)

Not Null

vendorname

vc()

Not Null

venagent

vc()

Null

lastused

date

Null

firstused

date

Null

vendorparts

venprtid

int(5)

PK

Not Null

vendorid

int(5)

FK

Not Null

partid

int(5)

FK

Not Null

source

vc()

Null

price

date

Null

discount

date

Null

The Vendor-Parts abstraction table is necessary because:

1) One Vendor can be the source for multiple Parts

2) The Same Part can be purchased from more than One Vendor