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 2nd question in 1st challenge

"Update the SQL statement to include the keywords to make sure the server doesn't error if it already exists."

Anyone have this solution? I know Im overthinking it--I just want to get through this one, as I have passed all the other challenges in this section.

3 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Debbie;

If you take a look at the video around the 4:30 mark Mr. Chalkley covers the usage of IF NOT EXISTS.

Happy coding,

Ken

Thank you-- I was WAY over-thinking it.

CREATE SCHEMA IF NOT EXISTS movie_db;

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;