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!
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

Shuddha Chowdhury
3,817 PointsHELP with SQL create table code challange database
Hey I have the following problem to solve : Create a table called "products" with a VARCHAR column named "name", a TEXT column named "description" and a INTEGER "stock_count" column. The name should be up to 100 characters long.
Here is my code :CREATE products(name VARCHAR(100) NOT NULL,stock_count INTEGER NULL ,description TEXT NOT NULL);
But it shows error and it didn't accept my work.I don't understand what is the mistake and problem here.Any help and explanation will be highly appreciated.
6 Answers

Danny Sauter
3,992 PointsThis did it for me:
CREATE TABLE products (name VARCHAR(100), stock_count INTEGER, description TEXT);
Go back and start this question over, it seems to stick if you do it wrong, so you need to clear the page and rest the question.

Caroline Hagan
12,612 PointsI tried this in phpMyAdmin and it worked ok...
CREATE TABLE 'mydatabase'.'products' (
'name' VARCHAR( 100 ) NOT NULL ,
'description' TEXT NOT NULL ,
'stock_count' INT NOT NULL
)

Brandon Biernat
12,549 PointsCaroline - I tried your recommendation and it still didn't work for me. I am having the same troubles with this one. I put:
CREATE TABLE products (name VARCHAR(100), description TEXT, stock_count INTEGER);
I can't seem to figure it out either.

Magnus Braathen
7,726 Points+1

Bryan Loesby
504 PointsI cant figure this one out either! Any help?

thomas howard
17,572 PointsLook at Danny's answer. The problem with the question may come from how small the text is on the video. It's hard to follow. you have to plug in what is asked, but without seeing how it's done by having the video ready to go, or taking notes while the lesson is rolling, well. I had to come up here and figure it out. Thanks.
Michael O'Malley
4,293 PointsMichael O'Malley
4,293 PointsSwitching up the ordered resolved the issue for me too. Found it a bit silly that if you follow the directions and do it in order -- it says you're incorrect.