Domanda

My tables are as follows :

instructors(instructorID(PK), name, address, contact_details, pps_number,
            job_desc, specialty)
admin(adminID(PK), name, address, contact_details, pps_number, job_desc)
equipment(equipmentID(PK), type_of_equipment, last_used_by, class_used_for,
          date_used)
members(memberID(PK), name, address, contact_number, payment_type,
        membership_paid)
receipt(receiptID(PK), date_and_time, supplier) 
classes(classID(PK), weights, abs, core_strength)

Can someone teach me how to normalize these please?

È stato utile?

Soluzione

"The key, the whole key, and nothing but the key, so help me Codd."

That's the "saying" about 3NF tables. Simply put, each table must contain a primary key (1NF). 2NF is "the whole key" which means that all attributes within each table must depend on the primary key of the table. 3NF is "nothing but the key." Requiring that non-key attributes be dependent on "nothing but the key" ensures 3NF. This means that non-key attributes cannot depend on attributes other than the primary key itself for any given table.

For example:

instructors(instructorID(PK), name, address, contact_details, pps_number, job_desc, specialty)

This table has a primary key, so it fits 1NF. 2NF states that all attributes depend on the key. For this table, I personally don't believe that the job_desc and specialty are dependent on the instructor itself as far as entity-attribute relationships go. For this, I would actually split that attribute into a new table like so.

instructors(instructorID(PK), name, address, contact_details, pps_number, job_ID)
jobs(job_ID, job_desc, specialty)

The Instructors table now fits 2NF. Now for the third normal form. 3NF is "nothing but the key" which means that non-key attributes cannot depend on attributes other than the primary key itself for any given table.

Let's look at instructor's attributes: instructorID(PK) - the PK itself.

name - Only dependent on the instructor itself.

address - Only dependent on the instructor itself.

contact_details - Only dependent on the instructor itself.

pps_number - I don't know what this is, so I can't say whether or not it should stay.

job_ID - Only dependent on the instructor itself.

This table now meets 3NF.

Here's some additional information on normalization that I found pretty helpful.

http://en.wikipedia.org/wiki/Third_normal_form

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top