The given SQL creates a Movie table and inserts some movies. The SELECT statement selects all movies. Modify the SELECT statement to select movies with the word 'star' somewhere in the title. Run your solution and verify the result table shows just the movies Rogue One: A Star Wars Story, Star Trek and Stargate. CREATE TABLE Movie ( ID INT AUTO_INCREMENT, Title VARCHAR(100), Rating CHAR(5) CHECK (Rating IN ('G', 'PG', 'PG-13', 'R')), ReleaseDate DATE, PRIMARY KEY (ID) ); INSERT INTO Movie (Title, Rating, ReleaseDate) VALUES ('Rogue One: A Star Wars Story', 'PG-13', '2016-12-16'), ('Star Trek', 'PG-13', '2009-05-08'), ('The Dark Knight', 'PG-13', '2008-07-18'), ('Stargate', 'PG-13', '1994-10-28'), ('Avengers: Endgame', 'PG-13', '2019-04-26'); -- Modify the SELECT statement: SELECT * FROM Movie;
The given SQL creates a Movie table and inserts some movies. The SELECT statement selects all movies.
Modify the SELECT statement to select movies with the word 'star' somewhere in the title.
Run your solution and verify the result table shows just the movies Rogue One: A Star Wars Story, Star Trek and Stargate.
CREATE TABLE Movie (
ID INT AUTO_INCREMENT,
Title VARCHAR(100),
Rating CHAR(5) CHECK (Rating IN ('G', 'PG', 'PG-13', 'R')),
ReleaseDate DATE,
PRIMARY KEY (ID)
);
INSERT INTO Movie (Title, Rating, ReleaseDate) VALUES
('Rogue One: A Star Wars Story', 'PG-13', '2016-12-16'),
('Star Trek', 'PG-13', '2009-05-08'),
('The Dark Knight', 'PG-13', '2008-07-18'),
('Stargate', 'PG-13', '1994-10-28'),
('Avengers: Endgame', 'PG-13', '2019-04-26');
-- Modify the SELECT statement:
SELECT *
FROM Movie;
Trending now
This is a popular solution!
Step by step
Solved in 2 steps