Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2008
    Posts
    4

    design question for a simple car sharing app

    We live in a house with 5 people and we share 2 cars. It's been working out ok but we thought it would be more efficient (and cool) to write a little application where we "checkout" cars a la zipcar. We're not looking to build anything fancy - just a basic registration system that (a) lets us know when the cars are available and (b) lets us reserve a car. I'm thinking of something like this:

    users (id, email)
    cars (id, title)
    hours(car_id, day_of_week, start_time, end_time)
    reservations (user_id, car_id, date, start_time, end_time)

    (The hours table needs to be there because our garage is open only within certain hours during the day). Am I thinking of the problem correctly? Any suggestions would be greatly appreciated before I spend the next few days (or weeks?) on this.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    suggestion: in the reservations table, replace 3 columns, date, start_time, end_time, with 2 columns, start_datetime and end_datetime

    otherwise, your tables look fine
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Sep 2008
    Posts
    2

    R V D

    nice thought

  4. #4
    Join Date
    Sep 2008
    Posts
    2
    the hours table can alone be sufficient if u can accomodate a column which specifies the state whether its past or presently running or is it reserved for future.....

Posting Permissions

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