What reference are you following? How can you be stuck if you are not following a reference procedure? What definitions & algorithms are you using for 2NF & 3NF?
i What normal form is the above table in?
Answer: It is in 1NF.
Question (i) doesn't make sense. Presumably they mean, what is the highest NF (normal form) this table is in. (In the list 1NF, 2NF, 3NF, ....)
Your answer to (i) doesn't make sense; every table in 2NF is also in 1NF. You mean it's in 1NF but not 2NF, or its highest NF is 1NF.
ii Say why it is not in 2NF.
Answer: SingerID
does not determine songName
, songGenre
or songLength
Your answer to (ii) doesn't make sense; it doesn't appeal to a definition or algorithm for 2NF or higher.
iii Re-design the Songs
table and make a table from it which is in 2NF.
Answer:
Singer{singerID, SingerName}
Song{SongID, songName, songLength, songGenre}
Songs{singerID, SongID}
Question (iii) doesn't make sense; normalization replaces a table by other tables. Maybe they meant something like "decompose it until you have a component that is in 2NF". But below I explain why they probably meant "make a design from it which is in 2NF".
Maybe you interpreted the question as "decompose it until you have a component that is in 2NF", agreeing with the first possible intent above. Or misinterpreted it as "make a bunch of tables from it which are 2NF", or, giving the same meaning, misinterpreted "table" as "design", agreeing with the second possible intent above. If the first, you don't say which component of yours is the answer, or that all of them are. Yours is a decomposition to all 2NF tables though.
iv Say why the table you produced in part (iii) is in 2NF and not in 3NF. State any assumptions you need.
For me this is 3NF.
Now I think all non-key attributes are functionally dependent on the primary key.
The two common definitions of 2NF are phrased in terms of not having any FDs of certain kinds that are said to be "in violation". One can always losslessly decompose in a certain way that gives smaller components where that FD is no longer a problem that can reasonably vaguely be referred to as "moving the FD to its own component, leaving another component". If you keep doing it then you would finally have all 2NF components--a 2NF design. (This is not part of good design, even to 2NF.) But if you "keep" a different one along the way then you "make" a different table that is "left". So there no particular table you would end up with unless you were told some some unusual way of decomposing in some ordered way. Moreover we can always decompose directly to 3NF, but question (iv) expects you not to do that.
Maybe question (iv) expects "the" table--assuming a certain definition, a certain kind of decomposition, and a certain ordering of decompositions. More likely question (iv) means "make a design from it which is in 2NF"--assuming a certain definition and a certain kind of decomposition.
Presumably you produced all 2NF tables via "moving" certain FDs per the above. (Non-trivial FDs with a nonprime attribute dependent on a proper subset of a CK). But your answer doesn't explain that. Moreover, PKs (primary keys) don't matter, CKs (candidate keys) do. If you mean there is only one CK in every table, you need to say so and justify it. But it still wouldn't/doesn't make sense, because it's not referring to a definition or algorithm for decomposition to 2NF or higher.
Your answer re 2NF vs 3NF doesn't make sense, you claim the tables are in 3NF and you are supposed to say why but you don't. (A reason Song is not in 3NF is its FD {songID} -> {songGenre}
is a transitive dependency of a non-prime attribute on a CK via songName
, or its FD {songName} -> {songGenre}
is a dependency of a non-non-prime attribute on a non-superkey.
PS When we are given a PK or CK, certain FDs (functional dependencies) must hold, and certain FDs can't hold, and certain combinations of FDs can & can't hold. When given a set of FDs that hold, the set of all FDs that must hold when those do is given by Armstrong's axioms, ie the transitive closure of the given set. Usually questions that give an FD set mean that the only FDs that hold are those, ie that the set is a cover for the FDs in the table. Sometimes we're told it's a minimal cover. Various algorithms use various sets. Unfortunately lots of questions say the FDs in a set hold but it's not clear whether it's a cover, ie whether other FDs not in the transitive closure could hold. Just like this question!
(Please find out what the questions are trying to say, find a reference for definitions & procedures/algorithms, and follow it until you get stuck. Then ask a new question.)