Results 1 to 3 of 3

Thread: Question about Database Normalization

  1. #1
    Join Date
    Feb 2013
    Posts
    1

    Question about Database Normalization

    Hey, I have a question about database normalization. I am making a database that stores spending expenses. I have two tables, merchant and receipts. For the receipts table, would I add a foreign key called merchant that links the merchant data to it or no would that violate the normalization rules? I have ID(primary key), date, total price, merchant(foreign key).

    Thank you

  2. #2
    Join Date
    May 2006
    Posts
    407
    I would have Merchant ID followed by the record ID with those 2 fields being the primary key.
    you do need the Merchant ID in the receipts table.

  3. #3
    Join Date
    Apr 2013
    Location
    Laurel, MD
    Posts
    27
    Like GolferGuy said you will need to add the Merchant ID as a foreign key in the receipts table for both your table to be linked and make sure that the relationship using that forign key is a one to many relationship since a merchant can have several receipt, but a receipt can only belong to one merchant.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •