Maracles Posted March 6, 2010 Share Posted March 6, 2010 I have 2 tables: 1 - title (the columns are: titleID, title) 2 - talent (the columns are: talentID, first_name, last_name) Titles in the first table are film titles, and entries in the second tables are actors. There can therefore be multiple actors in one film. How do I show this? I know I need a link table or some sort so that if for example; Indiana Jones = titleID of '1' Harrison Ford = talentID of '1' Steven Spielberg = talendID of '2' The link table would show two columns: col1 - titleID col2 - talentID The link table would then be: titleID talentID 1 1 1 2 I cannot figure out even after hours of trying how to select all talentID in the link table that have a titleID of 1. please help! Quote Link to comment https://forums.phpfreaks.com/topic/194299-query-help-needed-desperately/ Share on other sites More sharing options...
fenway Posted March 13, 2010 Share Posted March 13, 2010 Why won't a simple join work? Quote Link to comment https://forums.phpfreaks.com/topic/194299-query-help-needed-desperately/#findComment-1025704 Share on other sites More sharing options...
DaiLaughing Posted March 14, 2010 Share Posted March 14, 2010 A simple join would end up with a many-to-many relationship. Each actor will be in many films but each film will have many actors. You need an intervening table to record who was in what. Film -> actedIn <- talent. Can't think of a good name for the new table for some reason! Quote Link to comment https://forums.phpfreaks.com/topic/194299-query-help-needed-desperately/#findComment-1025836 Share on other sites More sharing options...
fenway Posted March 19, 2010 Share Posted March 19, 2010 The OP wanted to query the table, not design it. Quote Link to comment https://forums.phpfreaks.com/topic/194299-query-help-needed-desperately/#findComment-1028541 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.