A complicated Append query?

Emmy

Registered User.
Local time
Today, 02:46
Joined
Dec 5, 2001
Messages
14
I have a question about an append query:

I have exported a spreadsheet from Excel to a table in access:

Column 1:
Female
Telephone Number
Age

Column 2:
Jane
1234567
25

An explanation of how the database is set up:

* I have one table called "Gender", this table contains only 2 records (each with a unique ID): Male, Female, and Supervisor

* I have another table called "People": Each record in this table is either "Male" or "Female", or "Supervisor"

* I have one table called "Information Type", this table contains only 2 records (each with a unique ID): Telephone Number, and Age.

* I have another table called "Information", which lists telephone numbers, and ages as well as the record's "Parent Object" (either a Male or a Female)

i.e. Jane would be a record in the "People" table, but Jane's record would also be linked to 2 other records in the "Information Type" table - Telephone Number and Age

How can I write an append query so that:

* 1234567 and 25 are both appended to the "Information" table (thus 2 records will be appended) with "Jane" as the parent object for each record

Thanks very much in advance. Sorry for the length of this EMail.
 
I am at loss with your design.
Let me make an alternative proposal:

tblPeople
- PeopleID (Autonumber Primary Key)
- FirstName (string)
- LastName (string)
- GenderID (long int. foreign key from gender table)
- Age (consider date of birth instead?)

tblTelephone
- PeopleID (foreign key from People table)
- Telephone

tblGender
- GenderID (Autonumber PK)
- Gender

I personally would NOT use a tbl Gender, but define the gender field as boolean, and I would not neither use that field for another type of information (supervisor) but have a supplementary field supervisor (boolean) in the People table.
However, due to the fact you data come from an external source, you may have constraints that I don t know about?

If you do not intend to register more than one phone number per person in your DB, you may consider including the Telephone field in the People table also.

Alex
 

Users who are viewing this thread

Back
Top Bottom