Jump to content

Query help needed desperately


Maracles

Recommended Posts

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!

 

 

Link to comment
https://forums.phpfreaks.com/topic/194299-query-help-needed-desperately/
Share on other sites

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!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.