-1

Given the following relation:

school =(teacherID, list of kids)

I need to convert this to First Normal Form. My thought was that I have one table for teacherID then have a kids table with each kid have a kidID. Then I could connect each kidID to their correct teacherID. Would that fix the 1NF problem?

Mike Sherrill 'Cat Recall'
  • 91,602
  • 17
  • 122
  • 185
  • 1
    Normalization never introduces new attributes. You introduced `kidID`. – Mike Sherrill 'Cat Recall' Apr 01 '19 at 01:03
  • ["1NF" has no single meaning.](https://stackoverflow.com/a/40640962/3404097) Nor does "UNF" or "0NF". So you need to tell us your textbook name & edition. PS This surely look exactly like examples you have seen with only the names different, so what is your difficulty? – philipxy Apr 01 '19 at 05:31
  • Does this answer your question? [Normalization in database management system](https://stackoverflow.com/questions/40623169/normalization-in-database-management-system) – philipxy Feb 08 '22 at 01:30

2 Answers2

0

To satisfy the 1NF, you only need to have atomic data fields, so that the information of a column cannot be split into two.

For example, if you store the information of a teacher (teacherid, name) this would not be first normal form, because you can split name into first and last name.

A list of kids in one field is not atomic so have to split that into multiple records. So you need to have one entry for each kid, like (teacherID, kid1ID), (teacherID, kid2ID),...

dieckie
  • 74
  • 5
-1

It would, but it would also put it into 2nd normal form, which may or may not be desired for your purposes.

If, for whatever reason, you solely wanted it in 1st normal form you'd simply want it so that there's no cells which have more than one item of data. In this case turning the list of kids into a column, and having each kid have the teacher ID would be sufficient.

GeekKat
  • 24
  • 2
  • Okay, so could in fact do the kids table with each have. a kid id then a teacher table with teacher id, then combine the two. If I were going to rewrite the statement i put in the question would it be like preschool = (teacherID, kidID1, kidID2, kidID3.....)? – Kaitlyn Wheeler Apr 01 '19 at 00:06
  • You're over-complicating things. For first normal form, you don't need 2 tables. Just have the teacher ID listed multiple times in the table, each time with a different kid's name. For example, if you had the table 1 Ashley, Joey, Clarice 2 Leon, Esme, Josie You'd turn it into 1 Ashley 1 Joey 1 Clarice 2 Leon 2 Esme 2 Josie – GeekKat Apr 01 '19 at 00:10
  • Okay so I understand what the table would look like, but rewriting the relation in the question to 1NF, would that look like what I had in the previous comment? – Kaitlyn Wheeler Apr 01 '19 at 00:11
  • No, it'd be (Kid name, Teacher ID), since each name in this case is a record, not a column – GeekKat Apr 01 '19 at 00:14
  • The stuff re 2NF is unnecessary & confused. Eg A design cannot necessarily be kept in 1NF without being in a higher one. Eg Putting into 1NF is requested then 2NF satisfies that. – philipxy Apr 01 '19 at 05:37