Week 9 exercises

  1. In your own database, create tables to represent the following information:

At a track and field competition, there are 6 athletes: Dorothy Dietrich, Fay Presto, Doug Henning, Ellen Armstrong, Edgar Cayce, and Howard Thurston.

There are three events: the javelin throw at 10am, the 100m race at 1pm, and the pole vault at 3pm.

Create a table to represent the athletes, and a table to represent the events. Create a third table called 'results', which shows the following:

In the javelin throw, Dorothy Dietrich won gold, Doug Henning won silver, and Howard Thurston won bronze.

In the 100m race, Fay Presto won gold, Ellen Armstrong won silver, and Doug Henning won bronze.

In the pole vault, Ellen Armstrong won gold, Doug Henning won silver, and Dorothy Dietrich won bronze.

Note: there is no record of who participated in a given event, only who won a medal.

  1. Ensure that the 3 tables have appropriate data types assigned to each column.
  2. Ensure that the 3 tables have appropriate foreign keys.
  3. Create a view that will show the first and last names of the athlete, the name of the event, the time of the event, and the medal they won.
  4. Create a view that will output athletes that have not won a medal.