Author | Message |
---|---|
lmann2
Posts: 156
|
Posted 13:38 Jan 19, 2015 |
Hey all, I was a little confused by some of the questions on this exercise, read below:
If anyone has any ideas about these questions let me know! |
spanfer
Posts: 25
|
Posted 14:01 Jan 19, 2015 |
For Q3, its not about creating the least possible number of tables, follow the normalization guidelines for many to many relationship and redundancy. |
cysun
Posts: 2935
|
Posted 14:03 Jan 19, 2015 |
1. Yes (and I'm curious about the 2nd "equally valid" way). 2. Of course. 3. Don't worry about how many options you can choose - just choose the one (or ones) that you think is correct. |
lmann2
Posts: 156
|
Posted 14:12 Jan 19, 2015 |
For Q1, I had ignored normalization and that pretty much answers my question. However, my understanding for 1:N relationships is that you can create a third table that has the has the primary keys of both tables with the primary key of the new table being the primary key of the N side of the relationship. |
cysun
Posts: 2935
|
Posted 14:21 Jan 19, 2015 |
And in the same way you could create a fourth table, a fifth table, and so on and it would work, but I wouldn't consider it "equally valid" because it makes queries less efficient (due to an additional join) for no reason. |
tonyg
Posts: 11
|
Posted 11:21 Jan 20, 2015 |
For 7 and 8, do the options, "A foreign key column referencing the id column of the X table needs to be added to the Y table. ?" suggest that a new column is created in addition to the existing columns, or simply that an existing column is modified to act as a foreign key? |
cysun
Posts: 2935
|
Posted 11:51 Jan 20, 2015 |
The question is asking whether a new column needs to be created. |