Solved

Database normalization problem

Posted on 2006-10-28
7
220 Views
Last Modified: 2012-05-05
Hi all experts,
I have one question about normalization

I have a Initial Database as follow:
(Please copy and patse to Notepad, choose Courier Font)

================================================================
CLUB_CODE | CLUB NAME | ST# | ST_NAME | SUBJ# | SUBJ_NAME | MARK
================================================================
          |           |     |         | P1    | PHYSICAL  |  6
   EN     |  ENGLISH  |     |         | M1    | MATH 1    |  5
          |           | ST1 | JOHN    | C1    | CHEMICHY  |  8
----------|-----------|     |         | M1    | MUSIC     |  7
   CP     | COMPUTER  |     |         | D1    | DRAW      |  5
          |           |     |         | D2    |DATA STRUCT|  8  
=================================================================
          |           |     |         | P1    | PHYSICAL  |  4
   EN     |  ENGLISH  |     |         | M1    | MATH 1    |  7
          |           | ST2 | SMITH   | C1    | CHEMICHY  |  5
----------|-----------|     |         | M1    | MUSIC     |  7
   CP     | COMPUTER  |     |         | D1    | DRAW      |  8
          |           |     |         | D2    |DATA STRUCT|  9  
=================================================================
          |           |     |         | P2    | PHYSICALII|  5
   CP     | COMPUTER  |     |         | M3    | MATH II   |  7
----------|-----------| ST3 | MARK    | C2    | CHEMICHYII|  3
          |           |     |         | M2    | MUSICII   |  9
   FR     |   FRENCH  |     |         | D2    | DRAW II   |  5
=================================================================

   
Can you help me to move it into the 1st normal form (1NF) in 2 ways :
- flatterning
- split into attributes groups

Thank you in advance.

0
Comment
Question by:bufalobk
7 Comments
 
LVL 37

Accepted Solution

by:
momi_sabag earned 118 total points
Comment Utility
hi

you are already in the 1nf form
the 1nf form says that you should take out groups of data, but you don't have those in your design
if you wish i can help you get it in 3nf form,
but i will need you to tell me what is the meaning of each column


momi sabag
0
 
LVL 44

Assisted Solution

by:Arthur_Wood
Arthur_Wood earned 116 total points
Comment Utility
You need to add three new tables, Club, Student and Subject

Club
-----------------
Club_Code
Club_Name

Student
-----------------
St#
St_Name

Subject
---------------
Subj#
Subj_Name


then your main table becomes

MainTable
-------------------------
Club_Code   PK
St#             PK
SubJ#         PK
Mark

yes, that is a Composite PrimaryKey, made up of the three fields Club_Code, St#, SubJ#

AW

0
 
LVL 1

Assisted Solution

by:simonstre
simonstre earned 116 total points
Comment Utility
Your table in 1NF would be like this :

(CLUB_CODE, ST#, SUBJ#, CLUB NAME, ST_NAME, SUBJ_NAME, MARK) where CLUB_CODE, ST#, SUBJ# are the tree members of your primary key.

Your data would looks like this :

================================================================
CLUB_CODE | CLUB NAME | ST# | ST_NAME | SUBJ# | SUBJ_NAME | MARK
================================================================
   EN     |  ENGLISH  | ST1 | JOHN    | P1    | PHYSICAL  |  6
   EN     |  ENGLISH  | ST1 | JOHN    | M1    | MATH 1    |  5
   EN     |  ENGLISH  | ST1 | JOHN    | C1    | CHEMICHY  |  8
   CP     | COMPUTER  | ST1 | JOHN    | M1    | MUSIC     |  7
   CP     | COMPUTER  | ST1 | JOHN    | D1    | DRAW      |  5
   CP     | COMPUTER  | ST1 | JOHN    | D2    |DATA STRUCT|  8  
   EN     |  ENGLISH  | ST2 | SMITH   | P1    | PHYSICAL  |  4
   EN     |  ENGLISH  | ST2 | SMITH   | M1    | MATH 1    |  7
   EN     |  ENGLISH  | ST2 | SMITH   | C1    | CHEMICHY  |  5
   CP     | COMPUTER  | ST2 | SMITH   | M1    | MUSIC     |  7
   CP     | COMPUTER  | ST2 | SMITH   | D1    | DRAW      |  8
   CP     | COMPUTER  | ST2 | SMITH   | D2    |DATA STRUCT|  9  
   CP     | COMPUTER  | ST3 | MARK    | P2    | PHYSICALII|  5
   CP     | COMPUTER  | ST3 | MARK    | M3    | MATH II   |  7
   FR     |   FRENCH  | ST3 | MARK    | C2    | CHEMICHYII|  3
   FR     |   FRENCH  | ST3 | MARK    | M2    | MUSICII   |  9
   FR     |   FRENCH  | ST3 | MARK    | D2    | DRAW II   |  5

your groups would be the following : {CLUB_CODE, CLUB_NAME}, {ST#, ST_NAME}, {SUBJ#, SUBJ_NAME}, {MARK}

Eventually, when your data will be very normalized, it will appear in tables like this :

Students : ST#, ST_NAME (pk --> ST#)
Clubs : CLUB_CODE, CLUB_NAME (pk --> CLUB_CODE)
Subjects : SUBJ#, SUBJ_NAME (pk --> SUBJ#)
StudentsMarks : ST#, CLUB_CODE, SUBJ#, MARK (pk --> ST#, CLUB_CODE, SUBJ#)

Hope this helps.

0
 
LVL 7

Expert Comment

by:TRACEYMARY
Comment Utility
That very nice example authur......See if groups then split them to a new table.
Great
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction: I have seen many questions on EE and elsewhere, asking about how to find either gaps in lists of numbers (id field, usually) ranges of values or dates overlapping date ranges combined date ranges I thought it would be a good …
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now