Session Ready
Exercise

Add foreign keys to the "affiliations" table

At the moment, the affiliations table has the structure {firstname, lastname, function, organization}, as you can see in the preview at the bottom right. In the next three exercises, you're going to turn this table into the form {professor_id, organization_id, function}, with professor_id and organization_id being foreign keys that point to the respective tables.

You're going to transform the affiliations table in-place, i.e., without creating a temporary table to cache your intermediate results.

Instructions 1/3
undefined XP
  • 1
  • 2
  • 3

Add a professor_id column with integer data type to affiliations, and declare it to be a foreign key that references the id column in professors.