A2.4 COURSES Database Normalization

The table below lists the course-instructor-textbook assignments for courses taught during a particular semester at a fictitious community college a few years ago. Nakasone, Seita and Singer each taught one section of ICS101. Nakasone also taught a section of ITS129 and a section of ITS149. Seita also taught one section of BUS250. Singer also taught a section of ITS227.

Columns: 3, Rows: 10
COURSEINSTRUCTORTEXTBOOK
1BUS250SeitaBusiness Mathematics
2ICS101NakasoneMicrosoft Office 2019 Step-by-Step
3ICS101NakasoneTechnology in Action
4ICS101SeitaMicrosoft Office 2019 Step-by-Step
5ICS101SeitaTechnology in Action
6ICS101SingerMicrosoft Office 2019 Step-by-Step
7ICS101SingerTechnology in Action
8ITS129NakasoneA Guide to SQL
9ITS149NakasoneA Guide to SQL
10ITS227SingerWeb Programming with JavaScript

For textbooks, ICS 101 used two textbooks: "Technology in Action" and "Microsoft Office 2019 Step-by-Step." BUS 250 used "Business Mathematics", ITS 227 used "Web Programming with JavaScript." Both ITS 129 and ITS 149 used "A Guide to SQL."

Notice that even though the table is in BCNF, there is a lot of redundancy, which means update anomalies can still occur. The textbooks for ICS101 are in three places. The instructors for ICS101 are also in three places.

Assignment:

  1. Create an InnoDB database on your server named COURSES exactly.
  2. Import the above table into COURSES.
    • Name the table "ORIGINAL"
    • Set COURSE as varchar(10), INSTRUCTOR as varchar(50) and TEXTBOOK as varchar(100).
    • Make sure you specify the primary key correctly
  3. Decompose the ORIGINAL table into two tables in 4NF to eliminate the chance of an update anomaly occurring. Name your tables COURSE_TEXT and COURSE_INSTRUCTOR.
    • Make sure you specify the keys correctly.
    • Make sure populate the tables from the original table.
  4. Create a VIEW named VIEW_ORIGINAL with a NATURAL JOIN statement to produce the original relation back from your two 4NF relations.

When you are through, confirm you created your database correctly using the autograder.