Question: Produce a SQL query to form a junction table called movies_actors . A junction table is basically a table that contains foreign keys of

Produce a SQL query to form a junction table called "movies_actors". A junction table is basically a table that contains foreign keys of different tables together so that they form transaction table. This table have 2 variables only (movie_id and actor_id). The features of these variables (that should be considered while creating these variables) are provided below.  As can be seen, a sample is given (below) from the "movies_actors" table. 

  • movie_id isnumeric that has the "integer" typing and is a foreign key that should be referenced to the movie_id from the movies table.
  • actor_id isnumeric that has the "integer" typing and is a foreign key that should be referenced to the actor_id from the actors table.
  • Finally, note that both columns are the primary keys of this newly created table.

Step by Step Solution

3.46 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To create a junction table named moviesactors with two columns movieid ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!