Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2009
    Posts
    351
    Thanks
    75
    Thanked 0 Times in 0 Posts

    Class Diagram to Database Table Help

    Please see attached a class diagram that i have created. I am looking to design a normalised database for this project that i am doing for college.

    Here is what i have come up with so far.
    Can anyone tell me if this is correct or not?

    Dj Booking table
    id
    customerID
    venue
    Price
    eventDate
    StartTime
    FinishTime
    dateOfBooking
    PlaylistURL
    Occasion
    BookingType
    Note Status

    Equipment Booking table
    customerID
    Price
    venue
    status
    dateOfBooking
    BookingType
    Note
    Status
    Category
    equipmentReturned
    needsToBeDroppedOf
    EquipmentIDs

    Customer Table
    name
    contactNo
    address
    email
    sourceOfContact
    dateOfContact

    DJ Table
    name
    contactNo
    address
    email
    sourceOfContact
    dateOfContact

    Corporate Customer Table
    name
    contactNo
    address
    email
    sourceOfContact
    dateOfContact
    companyName

    EquipmentTable
    name
    category (should i have another table called category and have this field categoryid???)
    price
    dateOfPurchase
    serielNumber
    operational
    Attached Thumbnails Attached Thumbnails Class Diagram to Database Table Help-class-diagram2.jpg  

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,189
    Thanks
    75
    Thanked 4,341 Times in 4,307 Posts
    No, it is not correct. But neither is your ER diagram.

    Where is you BOOKING table???

    You seem to have subsumed it TWICE into EquipmentBooking and DJBooking. I think that's a mistake. Here, the ER diagram is right.

    I don't see the primary keys in any of your tables in the ER diagram. No bookingid for example. And you use customerid in your two booking tables but you don't have customerid as a primary key in your customers table. And and and and...

    Yes, you clearly need a category table.

    You have no fields at all in either the DJ table or the DJBookingTable that allows them to be linked together.

    I'm sorry, but both the ER and the classes need to completely reworked.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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