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

Databases Creating and Modifying Database Tables Creating and Modifying Database Tables Making Changes to a Database

Nameer Jamal
Nameer Jamal
309 Points

Now, in the MEMBERS table, we'd like to change the FAVORITE_ROCK column to be FAVORITE_ROCK_ID, and it should be a forei

Now, in the MEMBERS table, we'd like to change the FAVORITE_ROCK column to be FAVORITE_ROCK_ID, and it should be a foreign key for the ID column in the ROCKS table.

Unfortunately, in SQLite, ALTER will only let us rename columns. So to add the foreign key constraint we'll need to drop and recreate the table. Start by dropping the MEMBERS table.

1 Answer

Steven Parker
Steven Parker
231,275 Points

Despite the long-winded instructions, the objective of this task is to simply drop a table. If you've forgotten the syntax for doing that, there's an example of dropping a table in this part of the Creating the Ticket Holders Table video.