Tables question

C

Claudio_Martin

I am very very new to access and I am trying to create a DB from an Address
Book. My question is:
Is it better to create one Address Book table with several address types
(customer, vendor, employee, etc). Then create a Contact Type Table to
specify the diffferent contacts (names, last names and ph#s) for the same
address and then individual tables for customers, vendors, etc. Or create
these tables directly without creating the Address book and contact type
table....I'm confused....
 
P

Philip Herlihy

Claudio_Martin said:
I am very very new to access and I am trying to create a DB from an Address
Book. My question is:
Is it better to create one Address Book table with several address types
(customer, vendor, employee, etc). Then create a Contact Type Table to
specify the diffferent contacts (names, last names and ph#s) for the same
address and then individual tables for customers, vendors, etc. Or create
these tables directly without creating the Address book and contact type
table....I'm confused....

If you have a personal address book of friends and family, some of those
contacts may share an address. If, say, a married couple move, and
you have separate contact entries for them (more likely in the age of
mobile phones) then you'll probably end up having to change the address
on both entries separately.

If you're dealing with business contacts you may have hundreds of people
at one location, differing only in, say, room number. At that level it
becomes clearer that you need a "location" table containing the address,
and you'd include a reference (a foreign key) to the relevant location
in each contact item. If there's an office move, then you'll only need
to change one address in the whole database, and if some folk move to a
different office you simply change the reference in their individual
entry in the Contacts table.

I do think you want to have all your contacts in one table, as this
makes searching so much easier. You can add a field to the contact item
to show contact type.

It gets a little more complicated if you need to store different
information for the different contact types. You'd probably have very
different information about employees than you could for customers, for
example. In this case you can have a separate table of Employee details
(grade, salary, appraisal-rating, whatever) which contained a reference
(foreign key) to the Name and Address details in the Contacts list.
You'd set something similar up for vendors and for customers, but you'd
still be able to look up a mobile phone number, room number or email
address for any of them with the same query. If you need the full
address you use a query to "Join" information from more than one table.

Now, depending on how complicated your situation is, you might need to
have other information groupings set up as tables. If, for example, you
are a megga-corporation where salary depended directly on grade and
appraisal then you'd record that "rule" as a table which linked grade,
appraisal and salary. For an individual, you'd traverse the link from
the contact table to the employee table to get the grade and appraisal
score, and on to the "remuneration" table to get the salary. A bit
contrived, but I hope you get the idea.

This is confusing at first (even when well-explained!) but it does
become clearer. Have a look at these:

Free samples from Lynda.com on table design:
http://www.lynda.com/home/Player.aspx?lpk4=31001 (A2007)
http://www.lynda.com/home/Player.aspx?lpk4=13150 (A2003)

Microsoft tutorial on table design:
http://tinyurl.com/ms-table-design-tutorial

Table design is critical - get it right and everything is SO much easier!

Phil, London
 
F

Fred

Of course there's a lot to learn and do, but here's a guess at a start


You should create one table for each type of "entity" that you are
databasing.

Most likely you have two types of entities which are:

People
Organizations (includign companies etc)

And so those would be your two main tables.

Make fields in those tables for all of the other information,
classifications and attributes for each of those entities.


Create an autonumber Primary Key field in each. You might name them
something like People_ID and Organization_ID.

Then create a number field in your people table named Organization_ID.
(this would be called a foriegn key)

Then link the "Organization_ID" fields of your two tables to each other.

Hope that helps you get started.
 
N

Nigel

Contact databases can get very complicated. Here's what I would do:

Table: "Contact" (This is the "Primary" table)
Field: ID (Primary Key)
Field: Surname
Field: Given Names
Field: SalutationID (Lookup Salutation Table)

Table: "Salutation"
Field: ID (Primary Key)
Field: Salutation (Mr, Mrs, Miss, Dr, Hon, .... etc.)

Table: "Address"
Field: ID (Primary Key)
Field: ContactID (Lookup Contact Table)
Field: Address Type (Lookup AddressType Table)
Field: IsMailing (Yes/No)
Field: Address Line 1
.... etc
Field: Country (if required)

Table "AddressType"
Field: ID (Primary Key)
Field: AddType (Office, Home, Delivery, ... etc)

I deal with phone numbers in a similar way. Ie: Link a phone number table
to a Contact and link a PhoneType table to the phone numbers.

You should link Contacts to Company in the same way. Don't fall for the
trap of creating a field in the Company table that can hold many Contacts. I
tried this once and it was a disaster. Better to have a Company field in the
Contact table that looks up a company in the Company table.

I hope that all of this is helpful.

Cheers.
 
S

Steve Hayes

Contact databases can get very complicated. Here's what I would do:

Table: "Contact" (This is the "Primary" table)
Field: ID (Primary Key)
Field: Surname
Field: Given Names
Field: SalutationID (Lookup Salutation Table)

Table: "Salutation"
Field: ID (Primary Key)
Field: Salutation (Mr, Mrs, Miss, Dr, Hon, .... etc.)

I would call that "Title"

Salutation would be (Dear [Title], Sir/Madam, Hi there, Darling... etc)

Table: "Address"
Field: ID (Primary Key)
Field: ContactID (Lookup Contact Table)
Field: Address Type (Lookup AddressType Table)
Field: IsMailing (Yes/No)
Field: Address Line 1
.... etc
Field: Country (if required)

Table "AddressType"
Field: ID (Primary Key)
Field: AddType (Office, Home, Delivery, ... etc)

Would have Type as Postal, Residential etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top