Do I need to have a different table for each? An Apartment Number table,
Resident table, carpet table, Phone Number table?
Absolutely.
The first step in designing a database requires that you step away from the
computer. Turn it off, even. Get a pad of paper and a pencil (with a good
eraser, if my experience is a guide!).
Identify the Entities - real-life persons, things or events - of importance to
your application. Each type of entity - an Apartment, a Resident, a Carpet, a
Telephone - needs to have Attributes (discrete chunks of information that you
need to know about the entity). These attributes will belong only to that kind
of entity: a carpet doesn't have a wired/cellular attribute while a phone
number very well might. Each kind of Entity gets its own table; each Attribute
of an entity gets a field in that table.
Every Table needs a Primary Key. Autonumbers are often used for this purpose
but that's neither essential nor necessary. A Primary Key should meet three
requirements: it MUST be unique within the table (no two records can have the
same value); it SHOULD be stable, rarely or never changing; it HELPS if it's
compact (just so searching and sorting can be faster). For example, an
ApartmentNumber like "312A" meets all three conditions: you won't have two
apartments with that number, you won't often be changing it; and it's only 4
bytes long. A person's name is NOT a good choice, since it fails all three
critiera - different people sometimes do have the same name (I know three Fred
Browns for example), people change their names, and names can be lengthy.
If you find yourself with repeating fields - e.g. JanuaryPayment,
FebruaryPayment, MarchPayment - oops, you've found another entity (a Payments
event in this case) which needs another table.
You then need to identify the relationships between entities - for example,
Every Apartment has zero, one, or multiple Residents.
Every Resident resides in one and only one Apartment.
might be such a pair of rules, defining a One to Many relationship. To model
such a relationship in the table, create a field in the "many" side table
with the same datatype and size as the Primary Key in the "one" side table,
and use the Relationships window to link the two tables. This many-side table
field is called a "Foreign Key".
Check the tutorial links for further information.
John W. Vinson [MVP]