Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2014
    Posts
    1

    Unanswered: Entity Relationship Diagram

    I'm having a hard time figuring out which attribute would under which entity. Below are the Columns and Descriptions of the unnormalized data and my version of how the entities and attributes would belong.

    game_id - Game ID
    game_title - Game Title
    game_value - Cost of Game
    game_qty - # of copies available for each game
    game_cat_id -Game Category ID
    game_category - Category for each game
    member_id - Member's ID
    last - Member's Last Name
    first - Member's First Name
    license# - Member's Driver's License #
    St - Member's Driver's License Issuing State
    credit_card - Member's Credit card number
    Rental_id - Rental transaction ID
    Rent_date - Game Rent Date
    Return_date - Game Return Date
    Pay_method - Member's payment method for each transaction

    1st Entity:
    <u>Member</u>
    Member_Id
    Last
    First
    license #
    St
    Credit Card

    One to Many Relationship to 2nd Entity:
    <u>Rental</u>
    Rental_ID
    Rent_date
    Return_date
    Pay_Method

    One to One Relationship to 3rd Entity:
    <u>Game_Type</u>
    Game_Cat_ID
    Game_Category
    Game_value

    One to One Relationship to 4th Entity:
    <u>Game</u>
    Game_ID
    Game_Title
    Game_Qty
    Game_Cat_ID.

    I'm getting hung up on the 3rd and 4th entities and getting confused on the PK and FK.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    The PK (Primary Key) uniquely describes the current row.

    The FK (Foreign Key) describes what row this row is related to (usually the current row's logical "parent" in some sense).

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >I'm getting hung up on the 3rd and 4th entities and getting confused on the PK and FK.
    The PK is a unique identifier for a parent record.
    The FK is a unique identifier for a child record.
    A parent record can have 0 to N number of child records associated with it.
    A child record can only exist when the appropriate parent record exists.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  4. #4
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    In the rental table you might want to add the game_id to show what they are renting. Also how much is the rental. You will need a cost per rental in the GAME table and store the rental cost in the rental table, otherwise you could never change your rental cost.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Tags for this Thread

Posting Permissions

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