Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Database normalization problem

Posted on 2006-10-28
7
Medium Priority
?
266 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 37

Accepted Solution

by:
momi_sabag earned 472 total points
ID: 17825147
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 464 total points
ID: 17825210
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 464 total points
ID: 17825250
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
ID: 17828554
That very nice example authur......See if groups then split them to a new table.
Great
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

715 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