Solution: Create Dependent Table
Let's devise a solution for the multi-column attributes antipattern.
As we saw in the chapter Jaywalking, the best solution is to create a dependent table with one column for the multivalued attribute. Store the multiple values in multiple rows instead of multiple columns. Moreover, define a foreign key in the dependent table to associate the values to the key’s parent row in the Bugs
table.
In this lesson, we will create a dependent table to deal with multivalued attributes.
Creating a dependent table
Here we are creating a Tags
table that contains tags for the bugs and stores the information related to the bugs.
Get hands-on with 1400+ tech skills courses.