jamiesmith25
jamiesmith25

Reputation: 55

Normalising a form

I am really struggling to normalise a Client Meeting form.

The details are as follows

Client_Name, Client_phone (Normalised)

Date, Time, Location, Person_met, location, key_notes, Staff (repeating groups)

In 1st NF, I know the Client_Name (given a client_ID key) would be the foreign key in the repeated group, but I don't know which attribute would be the primary key.

Would Date and Time identify the meeting? Not sure if you can have two primary keys?

Any help would be much appreciated.

Upvotes: 0

Views: 98

Answers (2)

Joe
Joe

Reputation: 3347

personally I do not like composite keys unless there is a physical reason (eg: it will be used to jump hierarchies). I would suggest a surrogate key. PKs should be a naturally occurring, unique, mandatory and preferably stable (ie not modified). Since this happens rarely, a surrogate key ( a column added that is assigned an incremented number usually by the RDBMS) is normally (no pun) used.

In your example, date and time should not be the PK as there could conceivably be two meetings with that exact date and time ( as unlikely as that is, still...). If you have to have a composite key, then date, time and client name would be needed pt make it unique as the same client cannot participate in two meetings at the same instant (right?) Also, I notice location is in there twice. Probably needs to be a location id with location in a separate lookup table, per 3rd NF.

Upvotes: 0

Oren A
Oren A

Reputation: 5880

I think Date, Time and Location should be the composite primary keys (you probably can have more than one meeting at the same time..).
I'm not sure what you mean by "repeating groups" though.

Upvotes: 1

Related Questions