sql - Inserting Into and Maintaining Many-to-Many Tables -
sqlite3 user.
i have read thru numerous books on relational dbs , sql , not 1 shows how maintain linking tables many-to-many relationships. went through book went details of select , joins examples, glosses on same when many-to-many relationships covered. author showed pseudo code table, no data, , pseudo code query--wtf? missing something, has become quite maddening.
anyways, have table [people] 3 columns: pid (primary), name , age. table [groups] 3 columns: gid (primary), groupname , years. since people can belong multiple groups , groups can have multiple people, set linking table called [peoplegroups] 2 columns: pid, , gid both of come respective tables.
so ,how efficiently data linking table when inserting on others , how data out using linking table?
example: want insert "jane" [people] , make member of group gid 2, "bowlers" , update linking table {peoplegroups] @ same time. later want go , pull out list of of bowlers or groups person part of.
| when need new membership, add new record. problem that? – cl. apr 24 '14 @ 7:02 |