title: MySQL - moving from 1st Normal Form to 2nd and 3rd Normal Forms
body: <p>This question directly relates to a previous topic <strong>"MySQL - move from flat table to first normal form" (<a href="http://bit.ly/9pvS0Y" rel="nofollow noreferrer">http://bit.ly/9pvS0Y</a>)</strong> - and as I am now asking a question about moving to second and third normal forms, I figured it best to start a new topic.</p>
  
  <p>Below is my first normal form schema which I am pretty sure is solid enough for my purposes, but please correct me if I am wrong.</p>
  
  <p>I would like to know how to move this through to the second and third forms, any pointers as to how my tables would be affected by 2NF and 3NF rules would be really useful, thanks.</p>
  
  <p><strong>Relationships</strong></p>
  
  <p>-<em>Activity and Location</em> relationship = one to many - one activity can have one location, a location can have many activities (LocationID as FK in Activity)</p>
  
  <p>-<em>Activity and Week</em> relationship = one to many - one activity can have one week, a week can have many activities (WeekID as FK in Activity)</p>
  
  <p>-<em>User and Activity</em> = many to many - one user can have many activities, one activity can have many users</p>
  
  <pre><code>User Table - UserID PK
  +------------+-----------+
  | UserID     | Username  |
  +------------+-----------+
  |            |           |
  +------------+-----------+
  
  
  Activity Table - ActivityID PK / WeekID FK / LocationID FK
  +------------+-----------+------------+-----------+------------+-------------+-----------+
  | ActivityID | UserID    | WeekID     | Day       | Minutes    | LocationID  |   Miles   |
  +------------+-----------+------------+-----------+------------+-------------+-----------+
  |            |           |            |           |            |             |           | 
  +------------+-----------+------------+-----------+------------+-------------+-----------+
  
  
  Location Table - LocationID PK
  +------------+---------------+
  | LocationID | Location_Name |
  +------------+---------------+
  |            |               |
  +------------+---------------+
  
  
  Weeks Table - Week ID PK
  +------------+-----------+
  |WeekID      | Week_No   |             
  +------------+-----------+
  |            |           |
  +------------+-----------+
  
  
  User_Activity Table 
  +------------+---------------+
  | UserID     | ActivityID    |
  +------------+---------------+
  |            |               |
  +------------+---------------+
  </code></pre>