I have to do the following:
In 1.sql, write a SQL query to list the titles of all movies released in 2008. Your query should output a table with a single column for the title of each movie.
my sql file is this:
TABLE movies (
id INTEGER,
title TEXT NOT NULL,
year NUMERIC,
PRIMARY KEY(id)
);
And my code is:
sqlite> CREATE TABLE TITLES(titel)
...> INSERT INTO TITLES(titel)
...> VALUES (SELECT title FROM movies WHERE year = 2008);
Apparently it throws me this error:
Error: near "INSERT": syntax error
How can I solve this? thanks in advance