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 Database Foundations Creating Tables and Manipulating Data with SQL Creating a Database

SQL Create Database Issue

I'm going through the SQL course and I've come across an issue that I can't seem to solve. The question requires the syntax to create a database is MySQL and this is the code that I am passing. I've double and triple checked the code to make sure there are no syntax errors and it doesn't seem that there are, yet I still am getting errors saying that the answer is not correct. Any ideas?

create_db.sql
CREATE SCHEMA 'movie_db' ;

1 Answer

Christopher Stöckl
Christopher Stöckl
19,795 Points

Hi Tyler!

You're not allowed to use quotation marks for your database name. So your command should look like this:

CREATE SCHEMA movie_db;

Thanks Christopher! Works great! Do you know why in the MySQL Workbench when you click 'New Schema' and review the SQL Script that they use single quotes around the database name?

Christopher Stöckl
Christopher Stöckl
19,795 Points

Perfect :) No, sorry, I don't know why it shows up with quotation marks.

You can have a look in the official MySQL documentation about the correct syntax: https://dev.mysql.com/doc/refman/5.0/en/create-database.html