Normalization Issue

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
rfigley
Forum Commoner
Posts: 70
Joined: Sun Apr 21, 2002 7:10 pm

Normalization Issue

Post by rfigley »

I'm reorganizing a MySQL databse and need to check something. I have rows in a table that have some duplicate field data like gender (male, female) and occupation. The rows (example below) will be retrieved and displayed according to the Grp ID. Would it be necessary to separate these out to eliminate dupication (male, female, occupation) data with that guideline?

Person Name | Gender | Occupation | Car Model | Age | Grp ID


Thanks
rfigley
Forum Commoner
Posts: 70
Joined: Sun Apr 21, 2002 7:10 pm

Post by rfigley »

A Followup here:


Duplicates are with the Gender field (several of each in the table so those duplicate of course) the occupation and the Grp ID. For some stupid reason I was thinking each name had a unique Grp ID, but of course that is not the case as it is a list of people separated by groups. Fortunatley I have a field not mentioned here that is unique number for each person called "respondent" so I guess that field should be joined with a table to link the groups.
fractalvibes
Forum Contributor
Posts: 335
Joined: Thu Sep 26, 2002 6:14 pm
Location: Waco, Texas

normalization

Post by fractalvibes »

Difficult to say without seeing the structure of the other tables and how they relate, but given that you have 1 table:

Person_ID|Person Name | Gender | Occupation | Car Model | Age | Grp ID

You could have also:

group table
grp_Id | group name | other info special to this group

mbr_group_xref

person_id | group_Id

CarModelDomain
modelID | Model Description

if needed OccupationDOmain

occ_ID | OccupationDescription

so you can change that first table to:
Person_ID|Person Name | Gender | Occ_ID| ModelID | Age | GrpID


Hope this gives you an idea,

Phil J.
Post Reply