Breaking up one LARGE table into several smaller ones

E

erinb-tsc

Have a large table with way to much information in this one table. Would like
to break it into several different smaller tables for ease of use.

Old LARGE Table
Order and Payment Tracking

New Tables
Orders
Ship To
Bill To
Payments

Is there an easy way to separate/divide/break up this LARGE well established
table into smaller more managable ones? Any advise is welcomed.

Sincerely
Erin
 
S

Squik27

erinb-tsc said:
Have a large table with way to much information in this one table. Would like
to break it into several different smaller tables for ease of use.

Old LARGE Table
Order and Payment Tracking

New Tables
Orders
Ship To
Bill To
Payments

Is there an easy way to separate/divide/break up this LARGE well established
table into smaller more managable ones? Any advise is welcomed.

Sincerely
Erin

Hi, Here's scheme

Customer:
CustID,
Info...,
Shipping Address,
Billing Address.

Orders:
OrderID,
CustID.

OderDetails:
OrderID,
ProductID,
UnitPrice,
Quantity.

Payments:
OrderID,
CustID,
Amount,
Date.

Relations Are:
Custumer 1 ------- m Orders (A costumer can make many orders)
Orders 1 ---------m OrdersDetails (An order consist of many products; Keep
the unit price so if the product changes price that order still keeps the
price at moment of sale)
Costumer 1 --------m Payments (A costumer can make make many payment towards
an order)
Payments m ----------1 Orders (Many payment for the same order- for a
payment plan if you wish)

i hope this helps.
 
J

John W. Vinson

Have a large table with way to much information in this one table. Would like
to break it into several different smaller tables for ease of use.

Old LARGE Table
Order and Payment Tracking

New Tables
Orders
Ship To
Bill To
Payments

Is there an easy way to separate/divide/break up this LARGE well established
table into smaller more managable ones? Any advise is welcomed.

Sincerely
Erin

This can be a major hassle, but large chunks of it can be automated. The
details of the process depend on the nature of the data, of course; but you
would start by creating a properly normalized, relational integrity enforced,
well designed set of tables. Your four are a start, but I'd certainly consider
adding:

Companies
CompanyID
CompanyName
<other info about the company>

CompanyAddresses
AddressID <primary key>
AddressType <e.g. shipping or billing>
Address
City
State_Province
PostCode
Country

Contacts
ContactID
CompanyID <where does this person work>
LastName
FirstName
Phone
Fax
Email
<perhaps address info as well>

Once you have the tables, you would run many, many Append queries to migrate
the data from your wide-flat table into the new ones. If you have the same
company or person in the ShipTo and BillTo fields, they'll undoubtedly be
there under multiple spellings which will need manual resolution.

This kind of project has contributed to the prominent bags under my eyes and
hair loss, but it *can* be done.
 
E

erinb-tsc

John W. Vinson said:
This can be a major hassle, but large chunks of it can be automated. The
details of the process depend on the nature of the data, of course; but you
would start by creating a properly normalized, relational integrity enforced,
well designed set of tables. Your four are a start, but I'd certainly consider
adding:

Companies
CompanyID
CompanyName
<other info about the company>

CompanyAddresses
AddressID <primary key>
AddressType <e.g. shipping or billing>
Address
City
State_Province
PostCode
Country

Contacts
ContactID
CompanyID <where does this person work>
LastName
FirstName
Phone
Fax
Email
<perhaps address info as well>

Once you have the tables, you would run many, many Append queries to migrate
the data from your wide-flat table into the new ones. If you have the same
company or person in the ShipTo and BillTo fields, they'll undoubtedly be
there under multiple spellings which will need manual resolution.

This kind of project has contributed to the prominent bags under my eyes and
hair loss, but it *can* be done.

John

Thank you your intital help was very helpful and thought provoking.

If you don't mind thought I would run by you the break down of the tables I
have come up with. Would LOVE your prespective and advise.

Company Table
Company ID (Primary)
Company Name

Company Address Table
Company Name (Create relationship between Company and Company Address)
Address ID (Primary)
Address Type (Billing/Shipping)
Address
Address 2
City
State
Zip

Company Contacts Table
Contact ID (Primary)
Company ID (Create relationship)
Last Name
First Name
Position

Product Table
Product ID (Primary) (Part Number)
Description

Orders Table (Orders are from Dealers drop shipping to end customers, need
to track who, what, where and when)
Orders ID (Primary)
PO Number
Company ID (Bill To) (Create relationship?)
Company ID (Ship To) (Create relationship?)
Order Date
Address ID (Bill To) (Create relationship?)
Address ID (Ship To) (Create relationship?)
Contact ID (Bill To) (Create relationship?)
Contact ID (Ship To) (Create relationship?)

Order Detail Table
Order ID
Product ID (Subform?)
Quantity (Subform?)
Sales Amount
Freight
Total

Invoice/Shipment Table
Invoice ID (Primary)
Order ID (Create relationship?)
Invoice Date
Company ID (Create relationship?)

Commission Table (Payments)
Invoice ID (Create relationship?)
Order ID (Create relationship?)
Sales Amount
Commission Rate ID
Commission Amount Due
Commission Amount Paid
Date Paid

Commission Rate Table
Commission Rate ID (Primary)
Comission Rate

Please feel free to comment freely. Trying to create the best database first
time around, know this isn't always possible, but one can *hope*. Some of
these table are will be made into forms and numerous query will hopefully be
run to track payments, receivables and sales charts.

Thanks again for your previous help, looking forward to your response.

Sincerely
erinb-tsc
 
J

John W. Vinson

On Thu, 27 Aug 2009 10:04:01 -0700, erinb-tsc

Comments inline.
Thank you your intital help was very helpful and thought provoking.

Glad to be of help!
If you don't mind thought I would run by you the break down of the tables I
have come up with. Would LOVE your prespective and advise.

Company Table
Company ID (Primary)
Company Name

Avoid using blanks in fieldnames: CompanyID, CompanyName. They're legal but
can be a real hassle.
Company Address Table
Company Name (Create relationship between Company and Company Address)

Don't put the company *name* in this table - put the CompanyID instead.
Address ID (Primary)
Address Type (Billing/Shipping)
Address
Address 2
City
State
Zip

Company Contacts Table
Contact ID (Primary)
Company ID (Create relationship)
Last Name
First Name
Position

Again leave out the blanks. You may find yourself wanting a few more fields
but this is a good start.
Product Table
Product ID (Primary) (Part Number)
Description

Orders Table (Orders are from Dealers drop shipping to end customers, need
to track who, what, where and when)
Orders ID (Primary)
PO Number
Company ID (Bill To) (Create relationship?)
Company ID (Ship To) (Create relationship?)

Absolutely. I'd name the fields BillTo and ShipTo - parentheses in fieldnames
are a BAD idea.
Order Date
Address ID (Bill To) (Create relationship?)
Address ID (Ship To) (Create relationship?)
Contact ID (Bill To) (Create relationship?)
Contact ID (Ship To) (Create relationship?)

These may be redundant with the CompanyID - since you can look up the company
if you know the address (linking from Orders to Addresses and from Addresses
to Company) you may want to omit the CompanyID's in this table altogether.

If each company had only one address (or only two, ship-to and bill-to) you
could just include the addresses in the company table, but I'm sure that does
not reflect the business reality!
Order Detail Table
Order ID
Product ID (Subform?)
Quantity (Subform?)
Sales Amount
Freight
Total

A field isn't a subform! You would almost surely *USE* a subform (based on
OrderDetails) to enter data into the table, using a combo box to select the
product (this will let the user see the human-meaningful product name while
storing the computer-relevant ProductID). See the Northwind sample database's
Orders form for precisely this scenario.
Invoice/Shipment Table
Invoice ID (Primary)
Order ID (Create relationship?)
Invoice Date
Company ID (Create relationship?)

I'd separate these. You might have many shipments and only one invoice, or
many of each, not necessarily tied to one another.
Commission Table (Payments)
Invoice ID (Create relationship?)
Order ID (Create relationship?)
Sales Amount
Commission Rate ID
Commission Amount Due
Commission Amount Paid
Date Paid

Does a commission in fact relate *to a single invoice?*
Commission Rate Table
Commission Rate ID (Primary)
Comission Rate

Please feel free to comment freely. Trying to create the best database first
time around, know this isn't always possible, but one can *hope*. Some of
these table are will be made into forms and numerous query will hopefully be
run to track payments, receivables and sales charts.

Clarify:

Tables will NOT EVER be "made into forms".

Tables store data. They stay under the hood. Users should basically NEVER see
a table datasheet. You would develop Forms (many of them with subforms and
other tools) based on the tables, and the users would interact with the data
via these forms. You'll also develop Reports to print out (or provide a static
display) of data; charts can appear on either forms or reports, and may need
additional software such as Excel to produce them - charts and graphs are one
of the weaker features of the program.
Thanks again for your previous help, looking forward to your response.

You've bit off a large and complex project, but you've already clearly gotten
the principles well in hand! Good luck!
 
E

erinb-tsc

John W. Vinson said:
On Thu, 27 Aug 2009 10:04:01 -0700, erinb-tsc

Comments inline.


Glad to be of help!

Thanks again for your insight and thoughts. Once again they were very
helpful and thought provoking. Couple of questions and clarifications inline
below.
Avoid using blanks in fieldnames: CompanyID, CompanyName. They're legal but
can be a real hassle.

Don't put the company *name* in this table - put the CompanyID instead.

Again leave out the blanks. You may find yourself wanting a few more fields
but this is a good start.


Absolutely. I'd name the fields BillTo and ShipTo - parentheses in fieldnames
are a BAD idea.


These may be redundant with the CompanyID - since you can look up the company
if you know the address (linking from Orders to Addresses and from Addresses
to Company) you may want to omit the CompanyID's in this table altogether.

We deal with several businesses that have several branches and offices
throught out (6) states. Need to keep track of which branch ordered what when
and the end customers the product was shipped to. Believed the list above
would be the easiest way. A new provoked thought, you mentioned naming the
fields BillTo and ShipTo, which would be logical but how would that
link/create a relationship with the CompanyID of the respective dealer/end
customer?
If each company had only one address (or only two, ship-to and bill-to) you
could just include the addresses in the company table, but I'm sure that does
not reflect the business reality!


A field isn't a subform! You would almost surely *USE* a subform (based on
OrderDetails) to enter data into the table, using a combo box to select the
product (this will let the user see the human-meaningful product name while
storing the computer-relevant ProductID). See the Northwind sample database's
Orders form for precisely this scenario.


I'd separate these. You might have many shipments and only one invoice, or
many of each, not necessarily tied to one another.


Does a commission in fact relate *to a single invoice?*

Not exactly sure what you are asking above. There is a commission paid on
each invoice.
Clarify:

Tables will NOT EVER be "made into forms".

Tables store data. They stay under the hood. Users should basically NEVER see
a table datasheet. You would develop Forms (many of them with subforms and
other tools) based on the tables, and the users would interact with the data
via these forms. You'll also develop Reports to print out (or provide a static
display) of data; charts can appear on either forms or reports, and may need
additional software such as Excel to produce them - charts and graphs are one
of the weaker features of the program.


You've bit off a large and complex project, but you've already clearly gotten
the principles well in hand! Good luck!

Your telling me, but it is something that needs to be created and
accomplished.

Once this new/revised database is developed/created is there an easy way of
moving years worth of data from the old poorly designed database to the new
one without having to re-enter everything by hand?
 
P

Peter Hibbs

Yes, see my previous reply.

Peter Hibbs.


....Clipped...
Once this new/revised database is developed/created is there an easy way of
moving years worth of data from the old poorly designed database to the new
one without having to re-enter everything by hand?
 
J

John W. Vinson

:


We deal with several businesses that have several branches and offices
throught out (6) states. Need to keep track of which branch ordered what when
and the end customers the product was shipped to. Believed the list above
would be the easiest way. A new provoked thought, you mentioned naming the
fields BillTo and ShipTo, which would be logical but how would that
link/create a relationship with the CompanyID of the respective dealer/end
customer?

If the datatype of BillTo matches the datatype of CompanyID, you can join it;
you can have two joins, from BillTo and ShipTo. If you're assuming that the
field NAMES must match, don't worry - that's not a requirement.

The occurance of multiple locations for a company is a very good reason NOT to
have a link to Companies for bill-to and ship-to, though, but to link via the
address table as discussed below.
Not exactly sure what you are asking above. There is a commission paid on
each invoice.

That's what I was asking. Some businesses might pay a commission based on the
total sales over a period rather than for an individual invoice. Use your own
business's conventions of course!
Your telling me, but it is something that needs to be created and
accomplished.

Once this new/revised database is developed/created is there an easy way of
moving years worth of data from the old poorly designed database to the new
one without having to re-enter everything by hand?

Yes, as discussed elsewhere in this thread: a series of carefully crafted and
tested append queries. It's not time to discuss those yet until we have the
structure of your current data and of the new tables.
 

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

Top