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

Alexander Tam
Alexander Tam
371 Points

Databases

This seems really easy, but I don't know why I'm coming across this error.

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.

I put:

create table movies (title varchar(255), year integer);

The error:

The types for title and year are incorrect. Use VARCHAR(255) and INTEGER respectively.

Any ideas because this is exactly how the setup was in the video?

13 Answers

Chase Lee
Chase Lee
29,275 Points

Capitalize CREATE, TABLE, VARCHAR, and INTEGER.

Nicholas Lee
Nicholas Lee
12,474 Points

In "real' mysql capitalization is not necessary.

I'm not understanding why this is not working?

CREATE TABLE movies (title VARCHAR(255), year INTEGER);
Juliano Vargas
PLUS
Juliano Vargas
Courses Plus Student 15,575 Points

it keeps telling me that SQL Error: table movies already exists

I'm having the same problem to this day. I guess I'll skip it for now :(

I'm having the same problem to this day. I guess I'll skip it for now :(

This is what ended up being correct:

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

Tolga CANATAN
Tolga CANATAN
8,995 Points

Hi everyone,

When I typed these codes;

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

I got this error;

SQL Error: table movies already exists.

:(

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

works for me lol

Ali Syed
PLUS
Ali Syed
Courses Plus Student 565 Points

you need to go back, then skip to where you left off

Ali Syed
Ali Syed
Courses Plus Student 565 Points

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

Fenian Noakes
PLUS
Fenian Noakes
Courses Plus Student 5,212 Points

HI all - just incase someone else comes across this. don't use the full word INTEGER; instead just use INT. That worked for me. Cheers.

Michael Stopa
Michael Stopa
14,965 Points

It's not a bug, it's a feature:)) Same error on my end.

Database Foundations:

Challenge Task 1 of 2

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. Type in your command below, then press Enter.

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

Challenge Task 2 of 2

Create a table called "actors" with a VARCHAR column named "name". The name should be up to 50 characters long. Type in your command below, then press Enter.

CREATE TABLE actors (name VARCHAR(50));

Juliano Vargas
PLUS
Juliano Vargas
Courses Plus Student 15,575 Points

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

what's wrong with my sql query?

Juliano Vargas
PLUS
Juliano Vargas
Courses Plus Student 15,575 Points

Bummer! There's something wrong with your SQL statement. Please review your code and try again. Try again

CREATE TABLE movies (title VARCHAR(255), year INTEGER); Checking your answer...

Results Hide

There is something wrong their side. A bit disappointing...

getting the same error also,, quite disappointing