is this database relationship looks good? anybody can comment

Discussion in 'Databases' started by sally89, Mar 25, 2010.

  1. #1
    i have created a database for a room reservation. for this database i'm using mysql phpmyadmin.

    Right now it's just have the simple basic data that needed in the database. I hope someone can commeneted wether this database relationship look good or not...(eventhough i'm using mysql, i just make the ERD in access so that i can see relationship between the tables) especially part where the data relationship between the booking table and customer table.
     
    sally89, Mar 25, 2010 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    It looks good. This seems to be the most normalized structure for the given tables.
     
    jestep, Mar 25, 2010 IP
  3. mrx345

    mrx345 Peon

    Messages:
    68
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Why do you need two entities - customer and booking?
    If a new customer checks in - do you need an option to check if he stayed there before and select his info without typing? does it make sence to have this function?
    I would say it's easier to have one entity instead of these two... why are you making things complicated.
    Every time when a clients checks in they need to type his info... what if his address changes...
     
    mrx345, Jul 27, 2010 IP
  4. skytide

    skytide Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Looks fine to me.

    In response to one of your responses. You need two entities for customer and booking to make it relational. If you have the same customer making multiple bookings, and that data is all stored in one table, then you are going to have repeating customer data, which breaks the rules of relational databases.
     
    skytide, Jul 30, 2010 IP
  5. plog

    plog Peon

    Messages:
    298
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    0
    #5
    The relationships look good but to be nit-picky, I think your Booking table has more fields than it needs. My guess is that the field 'Nights' can be caclulated using the checkin and checkout fields, therefore you don't need a seperate field for it. The same might go for the 'totalprice' field--it can be determined using other pieces of data so the storing of it might not be necessary. However if the prices in your roomtype table change, but you don't want those updates to flow through to the Booking table; then you might actually need to store that data.
     
    plog, Jul 30, 2010 IP
  6. Amitoops

    Amitoops Well-Known Member

    Messages:
    1,388
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    148
    #6
    you have created preety well struture ,if you want to make it more relible you can take help of SQL or oracle.it will help you
     
    Amitoops, Aug 2, 2010 IP
  7. mynameishhs

    mynameishhs Peon

    Messages:
    85
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    looks good but its complex
     
    mynameishhs, Aug 12, 2010 IP