Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Creating Tables Code Challenge

I need help passing the first task! My code is:

CREATE TABLE movies (title VARCHAR(255), year INTEGER)

I took this straight from the movie and I get an error saying "Bummer! There's something wrong with your SQL statement. Please review your code and try again!" I can't figure out where I am going wrong... Thanks in advance!

2 Answers

David Lane
David Lane
33,414 Points

Don't forget your ; at the end of the statement.

Also if you are pressing "Try again" it is possible your getting a SQL error because the table already exists from your previous try. Refresh the page and try again with the above code and a ; at the end and it should work.

Thanks so much!

Alyssa :)

Eric Murphy
Eric Murphy
407 Points

Your code CREATE TABLE movies (title VARCHAR(255), year INTEGER)

The name of the table should be wrapped in back ticks ` and should indicated what engine mysql should use, a charset type, and finally a ; at the end mysql is like javascript, jquery and php and requires this at the end.

So at the end try this

CREATE TABLE `movies` (`title` VARCHAR(255), `year` INTEGER) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Hope this helps

Eric