Question: SQL ( 2 5 marks ) Answer the questions based on the following database which contains information about actors, movies and roles performed: Actor (

SQL (25 marks)
Answer the questions based on the following database which contains information about actors, movies and roles performed:
Actor (actor_id, name, year_born)
Movie (movie_id, title, author, year_show)
Role (actor_id, character_name, movie_id)
Where:
Actor is a table of actors, their names, and the year they were born. Each actor has a unique actor_id, which is a key.
Movie is a table of movies, giving the title, author name, and the year of shows for each movie. Each movie has a unique movie_id, which is a key.
Role records which actors have performed which roles (characters) in which movie. Attributes actor_id and movie_id are foreign keys to Actor and Movie respectively. All three attributes make up the key since it is possible for a single actor to play more than one character in the same movie.
a) Write the SQL statements that define / create the relational schema (tables) for this database. Assume that actor_id, movie_id, year_born and year_written are all integers, and that name, title, author, and character_name are strings. Be sure to define appropriate keys and foreign key constraints. (11 marks)
b) Show the relationship of the above tables in ER diagram using Crows Foot model. (6 marks)
c) What does it meant by referential integrity? Show how this integrity can be achieved through the example of tables as the above. (4 marks)
d) Write an SQL statement to find the name of the actor who born in year 1970.(4 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Programming Questions!