Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We've created a table with all the 'Harry Potter' movies, with a sequel _ id column that matches the id of the sequel for each

We've created a table with all the 'Harry Potter' movies, with a sequel
_
id column that matches the id of the sequel for each movie. Issue a SELECT that will show the title of each movie next to its sequel's title
(
or NULL if it doesn't have a sequel
)
.CREATE TABLE movies (id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT,
released INTEGER,
sequel_id INTEGER);
INSERT INTO movies
VALUES (1, "Harry Potter and the Philosopher's Stone", 2001,2);
INSERT INTO movies
VALUES (2, "Harry Potter and the Chamber of Secrets", 2002,3);
INSERT INTO movies
VALUES (3, "Harry Potter and the Prisoner of Azkaban", 2004,4);
INSERT INTO movies
VALUES (4, "Harry Potter and the Goblet of Fire", 2005,5);
INSERT INTO movies
VALUES (5, "Harry Potter and the Order of the Phoenix ",2007,6);
INSERT INTO movies
VALUES (6, "Harry Potter and the Half-Blood Prince", 2009,7);
INSERT INTO movies
VALUES (7, "Harry Potter and the Deathly Hallows Part 1",2010,8);
INSERT INTO movies
VALUES (8, "Harry Potter and the Deathly Hallows Part 2",2011, NULL);

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

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions

Question

=+ What is its mission?

Answered: 1 week ago