Creating the FilmsActors table in the Movies database Complete Programming Chall
ID: 3771712 • Letter: C
Question
Creating the FilmsActors table in the Movies database Complete Programming Challenge 9 before beginning this challenge. In this challenge, you will add a new table named FilmsActors to the Movies database. This table links films to actors, since one film may contain many actors, and one actor may participate in many films. Here are the columns: Field name Column type FilmId type int (1000) ActorId type int (100) When adding rows to this table, be sure you use FilmId values that match those already in the Films table, and ActorId numbers that match rows from the Actors table. Here is a sample row, for example, indicating that Keanu Reeves (ActorId = 100) was an actor in The Matrix (FilmId = 1000): 1000, 100 You will need to create a row in this table for every actor in the Actors table that acted in a film from the Films table. I will attach what the form is supposed to look like...
Explanation / Answer
Here is the Create Table syntax for you. Note that, you need both the tables Films, and Actors, for this table to be created successfully. If you need any further refinements, just get back to me.
CREATE TABLE FilmsActors (
FilmId int,
ActorId int,
PRIMARY KEY (FilmId, ActorId),
FOREIGN KEY (FilmId) REFERENCES Films,
FOREIGN KEY (ActorId) REFERENCES Actors)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.