title: time slot database design
body: <p>I am creating a database which need to allow booking a resource from start time to end time on a particular day. For example, I have 11 badminton courts. These courts can be booked for 1 hour and it can very also and in a day each court takes 18 bookings from morning 6 am till night 12 pm. (considering each booking is for one hour). The price of booking also varies from day to day, for example morning charges are more than day charges. Weekend charges are more than weekdays charges.</p>
  
  <p>Now my question is, is it advisable to pre-populate slots and then book it for user depending on the availability. But in this case for the abobe example If I need to store slots for next 1 month then I will have to store 11*18*30 = 5940 records in advance without any real bookings.Every midnight I will need to run script to create slots. If no of clubs increases this number can become huge. Is this good design for such systems? If not then what is the better designs in these scenerios.</p>
  
  <pre><code>club name||court || date || start_time || end_time || status || charge ||
  
  a           c1    20/04/2015   6:00        7:00       available
  a           c1    20/04/2015   7:00        8:00       available
  .
  .
  .
  a           c1    20/04/2015   11:00       24:00      available
  
  .
  .
  a           c11   20/04/2015   11:00       24:00      available
  </code></pre>