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 Code challenge

In Code Challenge: Altering Tables The first step is : Rename the "actors" table to "t_actor".

In the code area, I have typed in:

RENAME TABLE actors TO t_actor; Which gave me an bug. I have even tried multiple other lines:

RENAME TABLE "actors" TO "t_actor"; RENAME TABLE t_actor TO actors; RENAME TABLE "t_actor" TO "actors";

None of them seem to work. What am I doing wrong? Is this a bug?

Looks like a bug. I'm getting a result error on the "introduction-to-sql-2" and a connection error on the "creating-tables" code challenges.

Code tried:

SELECT * FROM movies;

Error:

/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/definition.rb:15:in build': /apps/treehouse_code_challenges/Gemfile not found (Bundler::GemfileNotFound) from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler.rb:135:indefinition' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler.rb:123:in load' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler.rb:107:insetup' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/setup.rb:17:in <top (required)>' from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'

Tuomo Kankaanpää
Tuomo Kankaanpää
13,574 Points

Seems to be a bug. Got the same error at codechallenge Git Basics > Workflows > Using Git-Flow.

James Barnett
James Barnett
39,199 Points

Patrick Conaty & Tuomo Kankaanpää - Looks like there was an problem with the code challenge engine site-side. Both the database & git code challenges should now be fix.

Sander de Wijs
Sander de Wijs
Courses Plus Student 22,267 Points

DB code challenge is working fine now James. Thanks for the fix!

1 Answer

DATABASE FOUNDATIONS / SQL

Challenge Task 1 of 4

Rename the "actors" table to "t_actor".

RENAME TABLE actors to t_actor;

Challenge Task 2 of 4

Rename in one SQL statment both the "t_movie" table to "movies" and the "t_actor" table to "actors".

RENAME TABLE t_movie to movies, t_actor to actors

Challenge Task 3 of 4

Remove the "actors" table from the database.

DROP TABLE actors;

Challenge Task 4 of 4

Truncate the "movies" table.

TRUNCATE table movies;