title: Timetable - database design
body: <p>I want to create a typical school timetable for each user.</p>
  
  <p><strong>The end product should look like this:</strong></p>
  
  <pre><code>+----+---------+---------+-----------+----------+--------+
  |  h | Monday  | Tuesday | Wednesday | Thursday | Friday |
  +----+---------+---------+-----------+----------+--------+
  |  1 | SCIENCE | MATHS   | ENGLISH   | FRENCH   | ART    |
  |  2 | SCIENCE | MATHS   | ENGLISH   | FRENCH   | ART    |
  |  3 |         | MUSIC   | HISTORY   | GEO      |        |
  |  4 |         | MUSIC   | HISTORY   | GEO      |        |
  |  5 | HEALTH  | PE      | MATHS     |          |        |
  |  6 | HEALTH  | PE      | MATHS     |          |        |
  |  7 |         |         |           |          |        |
  |  8 |         |         |           | SCIENCE  |        |
  |  9 |         |         |           | SCIENCE  |        |
  | 10 |         |         | PE        |          |        |
  | 11 |         |         | PE        |          |        |
  +----+---------+---------+-----------+----------+--------+
  </code></pre>
  
  <p>Now I want to create a MySQL table for this application.</p>
  
  <p><strong>My idea was this (but is this the best way because this table would have many many columns):</strong></p>
  
  <pre><code>+---------+-----+-----+-----+-----+-----+-----+-----+-----+-----+------+------+-----+-----+-----+-----+-----+-----+-----+-----+-----+------+------+-----+-----+----
  | user_id | mo1 | mo2 | mo3 | mo4 | mo5 | mo6 | mo7 | mo8 | mo9 | mo10 | mo11 | tu1 | tu2 | tu3 | tu4 | tu5 | tu6 | tu7 | tu8 | tu9 | tu10 | tu11 | we1 | we2 | ...
  +---------+-----+-----+-----+-----+-----+-----+-----+-----+-----+------+------+-----+-----+-----+-----+-----+-----+-----+-----+-----+------+------+-----+-----+----
  |    ?    |  ?  |  ?  |  ?  |  ?  |  ?  |  ?  |  ?  |  ?  |  ?  |   ?  |   ?  |  ?  |  ?  |  ?  |  ?  |  ?  |  ?  |  ?  |  ?  |  ?  |   ?  |   ?  |  ?  |  ?  | ...
  |    ?    |  ?  |  ?  |  ?  |  ?  |  ?  |  ?  |  ?  |  ?  |  ?  |   ?  |   ?  |  ?  |  ?  |  ?  |  ?  |  ?  |  ?  |  ?  |  ?  |  ?  |   ?  |   ?  |  ?  |  ?  | ...
  +---------+-----+-----+-----+-----+-----+-----+-----+-----+-----+------+------+-----+-----+-----+-----+-----+-----+-----+-----+-----+------+------+-----+-----+----
  </code></pre>
  
  <p>In conclusion: What would be the best design of a MySQL table for a typical school timetable (with user_id)?</p>
  
  <p>The user can input a text/subject-name for each lesson via many HTML text-fields (maybe there is also a better solution). But one important thing I forgot to say is that I have no courses-table.</p>