In a database, how can I export record from one table to another? (w/follow-up qus)

1308057

Registered User.
Local time
Today, 15:47
Joined
Jul 28, 2008
Messages
10
It is appreciated if you can kindly provide me some suggestion or advices, thanks!

I am establishing a database aiming at managing the client information & events attended by them.


table 1) Client information ------ e.g.
CompanyName | Address | Contact man | E-mail___ | Phone__ |
ABC INC ._______XXX Blg ___David____ ss@mail __9897789
**Company Name is primary key

table 2) Event information ------ e.g.
Event Name ___|Description | Event Date | Starting Time | Ending Time | __Venue__ |
New Year Cup __US vs UK ___07-Feb-08 __3:00:00 PM __5:30:00 PM XX Stadium
** Event Name is Primary key


In order to record "What clients went to which events"
I can only think of one method that, create 2 new table by using record of table 1 and table 2.

Table 3 e.g.
Event Name | Company Name 2 | Address 1 | Attendent | Direct tel |
New Year Cup ABC INC. ____________________Betty

Table 4's records are originally the same as table 1,
CompanyName 2 | Address | Contact man | E-mail___ | Phone _____|
ABC INC._______ XXX Blg____ Betty ____ss@mail _89898899


First, I would copy table 1 to generate table 4

What's more, I want an effect that, by updating information in Table 4, not letting table 1 be updated.
i.e. "Contact man". in table 4 is by default the value of "Contact Man" of table 1, "David". But if i want to change it, to "Betty", just change the value in table 4 but not table one as well.

Also, when there is new record in table 1, can it be automatically exported to table 4?

Would you please recommend me how can I achieve the above effect? many thanks!
 
Last edited:
Basically you never copy records from one table to another EVER.

You need to read up on Normalisation, Entity Associations, Primary Keys. Foreign Keys

Basically you have
Clients
Events

Then you have a table called Events_Clients

The PK from each participating table are FK's in the decomposed table and together they make a PK.

Other info such as date Number of attendees per client kept in new table

Len
 

Users who are viewing this thread

Back
Top Bottom