Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write SQL syntax for description : Movie movie_id– an integer and primary key fo

ID: 3841776 • Letter: W

Question

write SQL syntax for description :

Movie
movie_id– an integer and primary key for the Movie table.
movie_title- a character field that allows for up to 100 characters. This field should always have a value.
director_last_name– a character field that allows for up to 50 characters. This field should always have a value.
director_first_name– a character field that allows for up to 50 characters. This field should always have a value.
genre– a character field that allows for up to 20 characters that should always contain a value from the following
list of genres: Action, Adventure, Comedy, Romance, Science Fiction, Documentary, Drama, Horror.
media_type– a character field of up to 20 characters that can contain a value from the following list of mediums:
DVD, Blu-Ray.
release_date– a date field.
studio_name– a character field that allows for up to 50 characters.
retail_price– A real field that should always have a positive value.
current_stock– An integer field that should have a value of 0 or more.

Explanation / Answer

create table Movie(movie_id integer(10) primary key,movie_title varchar(100),director_last_name varchar(50),director_first_name varchar(50),genre varchar(20) check(genre in('Action', 'Adventure', 'Comedy', 'Romance', 'Science Fiction', 'Documentary', 'Drama', 'Horror')),media_type varchar(20) check(media_type in('DVD', 'Blu-Ray')),release_date date,studio_name varchar(50),retail_price integer(100) check(retail_price>0),current_stock integer(100) check(current_stock>0));