I am currently trying to perform the tasks in “Create Table” after completing the “Learn SQL” course.
Task1: Create a table for friends. I input the following SQL:
CREATE TABLE friends (id INTEGER, name TEXT, birthday DATE);
Press save, and so far so good. My database Schema pops up on the right hand side.
If I now proceed to task 2: Add Jane Doe to your table I remove the previous query and enter this SQL:
When you see the spinner and it never stops, that usually means there is something wrong with the SQL that you’ve used.
Those two line that you have posted there work for me, so I don’t think that is the problem. Reload/refresh your browser and try those two lines again.
You do have to press Save each time you add new code and wish to check to see if it is working. Once you are satisfied that you have accomplished each task then you check it off.
Putting SELECT * FROM friends; as the last line will show you everything in your database, that will help you decide if your command worked as you’d hoped.
I have the same exact issue. I think the problem is with the birthday column. I have used DATE, datetime, and datetime NULL as possible input types and none are accepted. The code appears to be entered correctly. I just haven’t tried 05/19/93 format yet. Hey code academy, everything is great on the site except you need to add clues just like you do on other exercises to ensure we are inputting everything correctly. My only gripe with your site.
Also on this particular section, if you refresh, you have to start all the way over and recreate the DB schema if Step 2 fails. at least thats what i’m running into. Goes from defined after successfully completing step 1 to undefined if you " incorrectly " enter the SQL statement for Step 2 of INSERTing the values for Jane Doe and her Birthday. Here’s my last attempt:
INSERT INTO friends, (name, birthday)
VALUES (‘Jane Doe’, ‘05/13/93’)
SELECT * FROM friends;
Here’s my second attempt:
INSERT INTO friends (name, birthday)
VALUES (‘Jane Doe’, ‘1993-19-05’)
I have tried every possible combination of the statements in IE, FF, and Chrome, none of them work. I also do not understand why I have to recreate the DB schema every time if I hit F5 and refresh the screen. I think there’s an issue with this website. I am also performing the action behind a corp firewall but I cannot see how that’s causing an issue
I have now found the time to continue with this excercise, but I still only get the spinner. I am fairly certain there are no problems with my SQL code (I tried it in a blank MS SQL database and it works without error):
Once again, Task 1:
CREATE TABLE friends (id INTEGER, name TEXT, birthday DATE);
I get success-message so I check task one.
Task2:
I remove my previous code and enter the following:
INSERT INTO friends (id, name, birthday) VALUES (1, 'Jane Doe', '1993-05-19');
SELECT * FROM friends;
After some further testing I see that if I keep my previous statements with me all the way I can complete each excersise without the spinner (ofcourse, provided that my SQL code is fucntioning).
i.e:
CREATE TABLE statement
INSERT statement
INSERT statement
INSERT statement
INSERT statement
UPDATE statement
ALTER statement
Append next statement
And so on…
I do not know if this is the expected way to complete it, but it worked for me.
I have a slightly different issue but on the same exercise. I keep getting the wrong date coming up when I do the final select to look at the results of the rows entered…
INSERT INTO friends (id, name, birthday) VALUES (1, ‘Jane Doe’, ‘1993-05-19’);
SELECT * FROM friends;