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 trialMarie Thompson
3,949 PointsDatabase- Create a table: It looks right to me and works in a separate SQL workspace on W3 Schools site
Here is the code challenge: "Create a table called "movies" with a VARCHAR column named "title" and an INTEGER column named "year". The title should be up to 255 characters long."
Here's my code:
CREATE TABLE movies
(
Title VARCHAR(255),
Year INTEGER
)
Here's the response: "Bummer! The types for title and year are incorrect. Use VARCHAR(255) and INTEGER respectively."
It looks right to me and works in a separate SQL workspace on W3 Schools site. Any ideas?
Thank you!
2 Answers
Galen Cook
2,463 PointsFound the challenge and got it to pass. So the instructions were a little misleading. Using SQL, you don't use VARCHAR and INTEGER, instead you use varchar and int.
CREATE TABLE movies ( title varchar(255), year int )
I've found that the w3schools SQL Quick Reference Guide is super helpful for SQL questions!
Galen Cook
2,463 PointsJust a thought:
The prompt asks for columns named "title" and "year". From what you've shown, you named your columns "Title" and "Year". The challenges tend to be pretty picky about their expectations. Try getting rid of the capitalization!
Marie Thompson
3,949 PointsThank you for your quick assistance Galen! Unfortunately, it still isn't working. I changed the capitalization, I've also tried with a space and without a space between VARCHAR and the paranthese. I even went as far as to switch title and year with its properties to see it the challenge was just backwards. No resolution. Any other ideas?
Marie Thompson
3,949 PointsMarie Thompson
3,949 PointsSuccess! Thank you for your help Galen! It is so interesting learning on the MS SQL Server Mgmt Studio and now trying this platform. I now see the minor differences I've heard about.