Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write SQL queries for each of the tasks using MySQL workbench. You cannot use Workbench's GUI to create database schemas and tables - you must

image text in transcribedimage text in transcribedimage text in transcribed

Write SQL queries for each of the tasks using MySQL workbench. You cannot use Workbench's GUI to create database schemas and tables - you must write your own SQL statements Follow the underscore convention when naming your database schema, entities and attributes Save your work as an SQL script-name your script 1. 2. 3. 4. 5. Submit your work via CourseWeb, Consider the relational database schema diagram below. It consists of 3 entities - movies actors, and locations. movis actors movie_has_actors movie has locations locations Because movies and actors have a many-to-many relationship and movies and locations have a many-to-many relationship, your schema would also have 2 junction tables - movies actors and movies locations. Each table's logical structure is described below movies Field name Primarv KevData tvpe Is null?| Is auto-increment? es INT no es Field name Primary KevData tvpe Is null? Is auto-increment? es no no no no INT VARCHAR(100 no VARCHAR(100 no DATETIME VARCHAR( 1000) no es no no no no no am no biograph locations Field name Primarv KevData tvpe Is null? Is auto-increment? es no no no no no INT VARCHAR( 100 no VARCHAR(150 no VARCHAR( 100 no CHAR(2 VARCHAR(5) es no no no no no no ci state Zi no no movies actors Field name Primary Kev Data tvpe Is null?Is auto-increment? INT INT no no no no no no movies locations Field name Primary Kev Data tvpe Is null?Is auto-increment? INT INT vi no no no no no no Task 1: Create a database called movie tracker using CREATE DATABASE statement. Task 2: In database movie tracker, create the following entity tables 1. movies 2. actors 3. locations Each tables logical structure should correspond to the descriptions provided in this assignment. Use CREATE TABLE statement. Task 3: In database movie_tracker, create the following junction tables: 1. movies actors 2. movies_locations Use CREATE TABLE statement to create junction tables. Make sure to create appropriate foreign keys-each table will have two foreign keys. Use ALTER TABLE statement to create foreign keys. Task 4: For each entity table, insert at least 3 rows using INSERT statement: 1. At least 3 movies in the movies table 2. At least 3 actors in the actors table At least 3 locations in the locations table 3. You can make up your own data for the INSERT statements Task 5: For each junction table, create at least 2 relationships (insert at least two rows of appropriate IDs)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions