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

Write the SQL statement to create a database called 'movie_db'.

I can't seem to pass this code challenge.

Write the SQL statement to create a database called 'movie_db'.

CREATE SCHEMA 'movie_db';

For some reason it's saying that this statement is wrong, can someone please tell me what I am not getting here.

Usually these code challenges provide you with some feedback. Do you know what it is saying exactly? Feel free to copy and paste error message as a reply.

Actually, replace CREATE SCHEMA with CREATE DATABASES and remove the quotes around movie_db

6 Answers

Nick Pettit
STAFF
Nick Pettit
Treehouse Teacher

Hi Dennis Flannigan,

What Rohit said is almost correct. To create a database, you want to use the CREATE DATABASE command. It's singular, and not plural. You also don't need the quotes.

I could give you the exact syntax, but that would defeat the purpose. I think you can figure it out from there. :)

Thanks Nick, I think I realise that I might have made a mistake there.

I still think it's a bug. Check my comment below

Andrew Chalkley
STAFF
Andrew Chalkley
Treehouse Guest Teacher

The automated "quotes" you're seeing aren't single quotes they are backticks. If you attempt to actually create a database in MySQL Workbench you'll see a syntax highlighting error like so:

I don't go over using backticks as they're optional. They are best used in circumstances where you're calling something the same as a keyword like the following example, a database call 'database':

CREATE SCHEMA database

You can utilize backticks like this:

CREATE SCHEMA `database`

The first statement will fail however the second will execute creating a database called 'database'.

One character out of place, for example the single quote or a backtick, no matter how similar they are, will cause unexpected results.

Hope that explains it a bit more and helps clarify any confusion with what you're seeing.

Hunter MacDermut
Hunter MacDermut
15,865 Points

I believe this is a bug as well. I was just able to pass the challenge by typing CREATE SCHEMA movie_db; (no quotes) after several failed attempts. In the videos (and in the Workbench application) it shows clearly the usage of quotes around the database name. And Andrew makes a point of the fact that the words schema and database are interchangeable when creating new databases.

I'm having the same exact problem! It must be a bug. The challenge says: Write the SQL statement to create a database called 'movie_db'.

and when I try any of these:

CREATE SCHEMA 'movie_db'; CREATE SCHEMA movie_db; CREATE DATABASE 'movie_db'; CREATE DATABASE movie_db;

I get the same message: Bummer! Your SQL statement to create a new database called movie_db is wrong.

Tony Cole
Tony Cole
4,256 Points

CREATE SCHEMA `movie_db`;

will pass the challenge also.

DATABASE FOUNDATIONS

Challenge Task 1 of 2 Write the SQL statement to create a database called movie_db.

CREATE SCHEMA MOVIE_DB;

Challenge Task 2 of 2 Update the SQL statement to include the keywords to make sure the server doesn't error if it already exists.

CREATE SCHEMA IF NOT EXISTS movie_db;