title: Theater database schema
body: <p>I have to implement a ticket selling service using php, where the user inputs the number of seats he/she wants, the system checks for availability and then presents random seats, the user confirms and the reservation is done.  </p>
  
  <p>First thing I have to do, is conclude to the database schema I will use. I am a little bit confused, so I will present you what I have thought so far. I really need your advice, in order to continue with the implementation.</p>
  
  <p>I have concluded to the following tables:</p>
  
  <ul>
  <li><code>Customer</code>: <code>id, name</code></li>
  <li><code>Ticket</code> : <code>ticket_id, time, price, seat_id</code></li>
  <li><code>Booking</code>: <code>id, customer_id, ticket_id</code></li>
  <li><code>Seat</code>: <code>id, status</code></li>
  </ul>
  
  <p>Τhe point is I am not sure about this, and pretty sure that it is false. For example the theater has a capacity (standard number of seats). So, where should I store this? Should I have a table <code>Theater: id, name, capacity</code> and when the admin completes for example the <code>capacity = 60</code>, then automatically I should make a query that inserts 60 records to the <code>Seats</code> table with <code>status=1</code> (available)? </p>
  
  <p>I am confused. I will have to think about it more carefully, but a second opinion, would be really very helpful for me.</p>