Link to home
Start Free TrialLog in
Avatar of Joseph Longo
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
SOLUTION
Avatar of John Kawakami
John Kawakami
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Joseph Longo
Joseph Longo

ASKER

Thank you!

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:
  1. Cash
  2. Check
  3. Cash & Check

The rental_terms will be how long the renter would like to rent the car seat for, in terms of months:
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5

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?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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?

User generated image
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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?
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.