Delivery_Services
Write the SQL code to create these tables. Specify which columns may not be NULL, and specify primary
and foreign key constraints. Note that the Delivery_Service column in the Deliveries table is
meant to have the same meaning as the Name column in the Delivery_Services table.
8.5 Here are the schemas for a few more of the tables in one implementation of the antique-store database:
Item
Sale
CHAP. 8] DATABASE 167
Deliveries
In pseudocode, outline how your program would record a sale. Show how you would use a transaction
to insure the integrity of the database updates. Also, explain the error checking (such as verifying that the
customer is already in the database) you would perform in your program, and how your program would
recover from problems such as:
??? The customer is not in the database.
??? The item number is not in the database.
??? The item is already sold.
8.8 When an item is sold, should the item row be removed from the Items table? Why or why not?
8.9 What transaction isolation level should apply to this application? Why do you make this choice?
168 DATABASE [CHAP. 8
CHAPTER 9
Social Issues
ETHICS THEORIES
Ethics is the rational study of different moral beliefs.
Pages:
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457