[Dbix-class] Newbie - database structure
Peter Edwards
peter at dragonstaff.com
Tue Feb 19 21:56:40 GMT 2008
From: Dermot
>Forgive me if I am being foolish with this query. I am not expert in
Databases and new to DBIx
>
>There is a section about making 3 tables with SQLite3; books, authors and
book_authors. The last table is described as
>'book_authors' is a many-to-many join table between books & authors'
>
>My query is: Is this the "best practise" or an over-simplification for us
newbies? Would you normally create a table for >joins to show many to many
relationships? I would have though that you could use SQL statements to
retreive that rather >than create a table of it.
To answer your question, yes, you need a join table. Each record in it
expresses a relationship between a record in table A and a record in table
B.
I'd recommend working through an SQL book that explains SQL concepts in more
detail as that really is a prerequisite for using a database or DBIC
effectively.
E.g. http://tinyurl.com/ywdxfu
Regards, Peter
http://perl.dragonstaff.co.uk
More information about the DBIx-Class
mailing list