Add to friends to the table "friends" - Not working


#1

https://www.codecademy.com/courses/learn-sql/projects/learn_sql_create_table

Upon choosing "SAVE" on the following code, I get the error message below:

...
CREATE TABLE friends (id INTEGER, name TEXT, birthday DATE )
INSERT INTO friends (id, name, birthday) VALUES (1, 'Jane Doe', 1993-05-19);
...
Error - Error: near line 1: near "INSERT": syntax error

I get the same error when putting a quote around the DATE

...
CREATE TABLE friends (id INTEGER, name TEXT, birthday DATE )
INSERT INTO friends (id, name, birthday) VALUES (1, 'Jane Doe', '1993-05-19');
...

Also, after creating the table, if I use a SELECT * FROM friends; it tells me it cannot find the table...like it isn't saving the table.

Anyone have an idea?


#2

You are missing the ; at the end of your CREATE statement.


#3

Ah, ok, I didn't realize it had to be at the end of every statement. I thought you were only to have it at the end of the overall string of commands. Thanks!


#4

I am not sure what is wrong with the following query?
CREATE TABLE friends (id INTEGER, name TEXT, birthday DATE);
INSERT INTO friends (id, name, birthday)
VALUES (1, "Jane Doe", "1993-05-19");
INSERT INTO friends (id, name, birthday)
VALUES (2, "HAMED", "1998-05-19");
INSERT INTO friends (id, name, birthday)
VALUES (3, "SAMAH", "1997-05-19");
INSERT INTO friends (id, name, birthday)
VALUES (4, "MAHSA", "1996-05-19");
SELECT * FROM friends;
UPDATE friends
SET name = "Jane Smith"
WHERE id = 1
SELECT* FROM friends;