1 / 7

Building the Database

Building the Database. Late Books!. So people are returning our books late and we now need to add a way to track our fines.  Define relationships and make tables. Resources. Agents. Events. Patrons. Books. Borrows Add Fines Add Fine was Paid. Cash AccountNumber (PK)

rian
Download Presentation

Building the Database

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Building the Database

  2. Late Books! • So people are returning our books late and we now need to add a way to track our fines.  • Define relationships and make tables

  3. Resources Agents Events Patrons Books • Borrows • Add Fines • Add Fine was Paid • Cash • AccountNumber (PK) • Beginning Balance • BankName • BankAddress • Account_Type Employees • Fines_Paid • Fines_Paid_ID (PK) • BorrowID (FK) • AccountNumber (FK) • Paid_Amount • Date_Paid

  4. Hey, new books are nice… • We want to be able make several payments on one purchase if it happens to be very expensive. • We also want to be able to pay for many inexpensive purchases with one payment. How could we do this? • (Hint—we need this to be Many to Many)

  5. Resources Agents Events • Money_Out • MoneyOutID (PK) • MoneyOutAmount • AccountNumber Many to Many relationships required an intermediate table to match the primary keys from each table. • Purchases_MoneyOut • PurchaseID(FK) • MoneyOutID(FK) • Purchases • Purchase ID (PK) • Merchant ID (FK) • Purchase_Date • Purchase Amount • Merchants • MerchantID (PK) • MerchantName • Address • Books • Add Purchase ID (FK)

  6. Resources Agents Events Money_Out Purchases_MoneyOut Merchants Purchases Patrons Borrows Books Cash Fines_Paid Employees

  7. Empty tables...how about some data? • We’ve worked so hard to make our tables and relate them, so the best way to celebrate is to import data!

More Related