I've designed complex databases (self-taught), but taking my first official database course in school; recently I've been assigned to design a database schema that is 2NF.
I've been working with a table formatted as follows:
Where STDNTNMBR
must be unique for all entries AND SSN
must be unique for all entries (not necessarily the combination of both). Essentially, both STDNTNMBR
and SSN
are both primary keys for the table.
At first glance, this table doesn't appear to be in 2NF because a non-prime attribute FIRSTNAME
is partial dependent, because it can depend on STDNTNMBR
or depend on SSN
.
My question is: how can I convert this table into 2NF?
It wouldn't make sense to have another table that maps STDNTNMBR
to SSN
, such as:
This type of relationship would have to be one-to-one, where StudentSsn.SSN
is the primary key, and the StudentSsn.STDNTNMBR
is a foreign key to Student.STDNTNBMR
.
Although this proposed solution isn't exactly clean, is it technically 2NF?
Or am I completely off-track?
Any help is much appreciated!