I am trying to create a bibliographic database, working with MySQL and Python, and I have a MySQL based question.
I understand how to link two tables together on a row by row basis using a scheme like this. However, references have a bit more complex structure. On any one reference you might have, say more than one author, and each author might contribute to more than one reference.
I could just have a table with rows for each author/work pairing, but that would make a messy table very quicky, and probably be a bear to query. What I would rather is some sleek way to allow for a ref_table that has a column for authors, with multiple authors listed by id, then a author_table with their id, name, and possibly a reverse reference to all works they authored.
I guess I could do this with some complex string parsing in Python, but it would seem to involve sending the entire author_table over the sql connection every time I wanted to update the ref_table. I was wondering if there were an easier more elegant way to do this within the MySQL server itself. Any ideas? Thanks.
I understand how to link two tables together on a row by row basis using a scheme like this. However, references have a bit more complex structure. On any one reference you might have, say more than one author, and each author might contribute to more than one reference.
I could just have a table with rows for each author/work pairing, but that would make a messy table very quicky, and probably be a bear to query. What I would rather is some sleek way to allow for a ref_table that has a column for authors, with multiple authors listed by id, then a author_table with their id, name, and possibly a reverse reference to all works they authored.
I guess I could do this with some complex string parsing in Python, but it would seem to involve sending the entire author_table over the sql connection every time I wanted to update the ref_table. I was wondering if there were an easier more elegant way to do this within the MySQL server itself. Any ideas? Thanks.
Comment