Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,158,366 members, 7,836,475 topics. Date: Wednesday, 22 May 2024 at 08:34 AM

Database Normalization (help Please) - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Database Normalization (help Please) (2172 Views)

Help:..please Does Anybody Know How I Can Make A Gps Driven App / Need Programmers Help Please / Database Normalization (help Please) (2) (3) (4)

(1) (Reply) (Go Down)

Database Normalization (help Please) by salix9ice(m): 7:27am On Mar 16, 2012
Can someone help me group the below attributes to 1NF,2NF and 3NF

Un-Normalized form (UNF)
All Staff (Staff_ ID, staff _name, staff_ address, staff_ home phone number, start_ date, tax_ file number, year _to date gross salary, tax deduction amt, EPF_ deduction amt, job_ code, job_ description, skills_ code, skills_ description, annually_ salary, hourly_ rate, {project_ contract number, project_ start date, contact_ phone number , project_ code, project_ name}).
Re: Database Normalization (help Please) by AZeD1(m): 3:35pm On Mar 16, 2012
Staffs should have their own table(Staff_ ID, staff _name, staff_ address, staff_ home phone number, start_ date, tax_ file number,)
Jobs should have their own table(job_ code, job_ description)
Renumeration should have its own table(annually_ salary, hourly_ rate)
Project should have its own table(project_ contract number, project_ start date, contact_ phone number , project_ code, project_ name)
Skills should have its own table(skills_ code, skills_ description)

Can someone help me group the below attributes to 1NF,2NF and 3NF
Normalisation is a process of refining you database to get the optimal design. e.g what you posted can be called "1NF" what i posted can be called "2NF".

Hope i explained what i think is your question.

1 Like

Re: Database Normalization (help Please) by eazyd(m): 10:53pm On Mar 26, 2012
A-ZeD:
Staffs should have their own table(Staff_ ID, staff _name, staff_ address, staff_ home phone number, start_ date, tax_ file number,)
Jobs should have their own table(job_ code, job_ description)
Renumeration should have its own table(annually_ salary, hourly_ rate)
Project should have its own table(project_ contract number, project_ start date, contact_ phone number , project_ code, project_ name)
Skills should have its own table(skills_ code, skills_ description)


Normalisation is a process of refining you database to get the optimal design. e.g what you posted can be called "1NF" what i posted can be called "2NF".

Hope i explained what i think is your question.

3NF is you find the functional dependencies in 2NF , create Candidate and Foreign keys.
Re: Database Normalization (help Please) by Kobojunkie: 11:27pm On Mar 26, 2012
@Poster, there is a tool called DBFabDesigner

http://www.fabforce.net/dbdesigner4/screenshot_image.php?screenshot=dbd4_ss_simplemodel.png


Download it and learn how to use it in designing your database. Post your examples on here so others can get an idea of what you are working on, in order to better help you.
Re: Database Normalization (help Please) by farouqzaib: 8:08am On Mar 27, 2012
If you are going to go along with A-Zed suggestions, you need a unique key/field to identify each staff. I think he forgot to add that or he assumed you knew it.

Please don't use a tool yet expect you wanna compare after you come up with your own draft. I suppose you are still in the learning phase, no need to bust out the

pro tools yet.

All the best.
Re: Database Normalization (help Please) by okeyxyz(m): 8:22am On Mar 29, 2012
what A-Zed has done is move straight to 3NF without illustrating the sequence from 1NF, 2NF to 3NF. i also would organize my data a bit different as follows:

1NF:
1, eliminate duplicate columns from the same table
2, create separate tables for each group of related data
3, identify each row with a primary key


i would consider project contact_phone_no & staff_home_phone_no as duplicate columns, since they both refer to phone numbers, likewise staff_start_date & contract_start_date. However, this is not a strict prescription, ultimately how you organize your data will depend on their relationships within the business environment, eg you could further decide to have a separate table for addresses, but i'm not gonna touch that.

staff_table(staff_id(PK), staff_name, staff_address),
jobs_table(job_code(PK), job_description),
remuneration_table(id(PK), year_to_date_gross_salary, annual_salary, hourly_rate),
taxation_table(tax_file_number(PK), tax_deduction_amt, EPF_deduction_amt),
skills_table(skills_code(PK), skills_description),
project_table(project_contract_no(PK), project_code, project_name),
phone_table(id(PK), staff_home_phone, contact_phone_no),
start_date_table(id(PK), start_date)


2NF:
1, remove subsets of data that apply to multiple rows of a table & place them in separate tables
2, create relationships between these tables & their predecessors by the use of foreign keys

staff_table(staff_id(PK), staff_name, staff_address, job(FK), remuneration(FK), taxation(FK), skills(FK), start_date(FK)),
jobs_table(job_code(PK), job_description),
remuneration_table(id(PK), year_to_date_gross_salary, annual_salary, hourly_rate),
taxation_table(tax_file_number(PK), tax_deduction_amt, EPF_deduction_amt),
skills_table(skills_code(PK), skills_description),
project_table(project_contract_no(PK), project_code, project_name, skills(FK), start_date(FK), phone_no(FK)),
phone_table(id(PK), staff_home_phone, contact_phone_no),
start_date_table(id(PK), start_date)

3NF:
remove columns that are not dependent on the primary key


from the project_table, one could argue that project_contract_no or project_code & their dependants be removed from the table because there might be many projects with unique contract_nos but the same project_code therefore creating a necessity for a project_codes table, but i'm not gonna touch that here, this is just a demonstration of how 3NF is achieved like the OP requested.

1 Like

Re: Database Normalization (help Please) by Nairaplus(m): 10:12am On Mar 29, 2012
Interesting tutorials!

(1) (Reply)

Guys, I Need Help With This Reactjs Issue Please. / Synchronize Tow Mysql Databases (remote And Local) / A Critical Look At Nairaland's Anti-spam Bot Or Whatever...

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 21
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.