P
PaulAlex
Hello all. I am relatively new to Access and SQL (started playing with
it a few days ago), and so I have a question on the best way to move
multiple authors into a junction table.
Here's the deal:
1)
I had a flat-file database of a bunch of books, in CSV format. The
fields consisted of:
title
auth1_firstname
auth1_lastname
auth2_firstname
auth2_lastname
auth3_firstname
auth3_lastname
auth4_firstname
auth4_lastname
pubmonth
pubyear
isbn
desc(ription)
2)
In Access, I created three tables: Books, Authors, BooksAuthors, and
Publishing.
The Books table has the Title and Desc fields, plus BookID which is
AutoNum (AN) and a Primary Key (PK).
The Authors table has AuthorID (designed as AN and PK), and has all of
the Auth* fields listed above. I know this isn't set up right, and
once I get this set up right, I believe everything else will fall into
place..
The Publishing table has PubMonth, PubYear and ISBN.
The BooksAuthors table has BookAuthID as a AN and a PK. In addition, I
used the LookUp Wizard to create two more fields: link_BookID and
link_AuthID, which link to the respective fields in the Books and
Authors tables.
I had read about junction tables, and fits my scenario, since I do
have books that have multiple authors, and authors who have written
more than one book.
3)
I imported my CSV table into a Holding table.
Currently the Holding table has all the data and all the fields from
the CSV file.
My plan is to use a bunch of SQL queries to move all that data from
Holding into the various other tables (once I learn about Append,
Update and other SQL statements, that is).
4)
But my question would be: How do I move the auth1_* and auth2* and
auth3* and auth4* data to in such a way that they are linked?
-- Paul
it a few days ago), and so I have a question on the best way to move
multiple authors into a junction table.
Here's the deal:
1)
I had a flat-file database of a bunch of books, in CSV format. The
fields consisted of:
title
auth1_firstname
auth1_lastname
auth2_firstname
auth2_lastname
auth3_firstname
auth3_lastname
auth4_firstname
auth4_lastname
pubmonth
pubyear
isbn
desc(ription)
2)
In Access, I created three tables: Books, Authors, BooksAuthors, and
Publishing.
The Books table has the Title and Desc fields, plus BookID which is
AutoNum (AN) and a Primary Key (PK).
The Authors table has AuthorID (designed as AN and PK), and has all of
the Auth* fields listed above. I know this isn't set up right, and
once I get this set up right, I believe everything else will fall into
place..
The Publishing table has PubMonth, PubYear and ISBN.
The BooksAuthors table has BookAuthID as a AN and a PK. In addition, I
used the LookUp Wizard to create two more fields: link_BookID and
link_AuthID, which link to the respective fields in the Books and
Authors tables.
I had read about junction tables, and fits my scenario, since I do
have books that have multiple authors, and authors who have written
more than one book.
3)
I imported my CSV table into a Holding table.
Currently the Holding table has all the data and all the fields from
the CSV file.
My plan is to use a bunch of SQL queries to move all that data from
Holding into the various other tables (once I learn about Append,
Update and other SQL statements, that is).
4)
But my question would be: How do I move the auth1_* and auth2* and
auth3* and auth4* data to in such a way that they are linked?
-- Paul