Joseph Longo
asked on
MySQL-Design Help
Hello Experts,
I am creating a car seat rental program, using PHP & MySQL. I am not super familiar with designing databases, so I was wondering if those of you who have experience designing them can help me tweak my design or offer any suggestions.
Below is a picture of my database schema/structure:
[embed=file 1156254]
IMG_0848.PNG
I am creating a car seat rental program, using PHP & MySQL. I am not super familiar with designing databases, so I was wondering if those of you who have experience designing them can help me tweak my design or offer any suggestions.
Below is a picture of my database schema/structure:
[embed=file 1156254]
IMG_0848.PNG
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Albeit antiquated, we only accept cash and/or check at the moment.
I will modify my table to rental_term (time frame), as I should also probably consider including the rental_terms (contract) too. Again, I am kind of walking around in the dark a little here.
Do you think it would be important to store the rental_terms in a database?
I will modify my table to rental_term (time frame), as I should also probably consider including the rental_terms (contract) too. Again, I am kind of walking around in the dark a little here.
Do you think it would be important to store the rental_terms in a database?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Here are some modifications I've made to my database and its tables. Can you think of ANY other information I might want to collect? The deposit for renting a car seat is refunded, upon returning the car seat. Do you think I should track, in my database, as to whether or not the refund was issued in its own table?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
If state_id is the PK, then would the renters table contain the id of the corresponding state? Do you think it would be beneficial to have a refund_status table, which contains the agreement_id (foreign key), refund_sent, refund_date or should it be structured differently?
ASKER
Thank you for your assistance! Through your answers, I have designed, what I consider, to be a great database that meets my program's requirements.
ASKER
The reason I created a seat_id column is because, according to our receptionist, some of our car seats contain the same serial number, so the serial_number is not unique.
Ray, I am a little confused about structuring/relating the tables, explaining the rental_terms and deposit_type. Basically, we will have three different deposit types:
The rental_terms will be how long the renter would like to rent the car seat for, in terms of months:
I agree! I have added seat_status and deposit_amount to their respective tables. Any other ideas on how to tweak the database and its tables?