First page Back Continue Last page Image

Referential Integrity Breech by Deletion

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

dec()

Null

discount

dec()

Null

What if I discontinue a Part but this is the only part Vendor x Provides us with

inventory

partid

partname

partdescription

partinventory

partcost

44

Widget1

Cool new ...

16

$27.83

32

Gismo4

Special ve...

7

$75.34

16

thingy8

Test sys...

2

$4.55

9

bob

Robot for ...

8

$345.00

vendor

vendorid

vendornbr

vendorname

venagent

lastused

2345

1

Buzz Worth

224

02/04/20

7648

2

Lost Token

13

09/15/20

3245

3

Endless Dot

56

03/03/21

1123

4

Freak Order

82

06/01/21

vendorparts

venprtid

vendorid

partid

source

price

  • discount

9

2

16

primary

$2.43

  • $0.20

If I delete either of these entries without deleting the other, I end up with a database inconsistency