Question: 3 . 1 0 . 1 : LAB - Select number of movies grouped by year 0 / 1 0 The Movie table has the
: LAB Select number of movies grouped by year
The Movie table has the following columns:
ID integer, primary key
Title variablelength string
Genre variablelength string
RatingCode variablelength string
Year integer
Write a SELECT statement to select the year and the total number of movies for that year.
Hint: Use the Initialize Movie table
DROP TABLE IF EXISTS Movie;
CREATE TABLE Movie
ID INT unsigned NOT NULL AUTOINCREMENT,
Title VARCHAR
Genre VARCHAR
RatingCode VARCHAR
Year INT,
PRIMARY KEY ID
;
INSERT INTO Movie
VALUES
'Becoming','Documentary',PG
'Den of Theives','Action',R
'Arctic Dogs','Family',PG
'Dangerous Lies','Action',NULL,
'All Day and a Night','Drama',R
'Extraction','Action',R
'Madagascar: Escape Africa','Family',PG
'The Willoughbys','Family',PG
'Despicable Me'Family',PG
'Armed Response','Action',R;
COUNT function and GROUP BY clause.
Initialize database
source Initialize.sql
Your SELECT statement goes here
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
