Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Databases Modifying Data with SQL Adding Data to a Database Adding Multiple Rows to a Table

Tony Lawrence
Tony Lawrence
3,056 Points

Trouble with Running SQL in Workspace.

Hi,

I'm having trouble with my workspace when following the steps as in the video to build up some muscle memory. However, when I run the script I get an error like this: Error: UNIQUE constraint failed: books.title. I notice in the table that I insert that the information has already been inserted. Is this problem occurring because that specified information is already in there? (I doubt that since the new command would just overwrite the information.)

Thanks

Little late i know, but what is happening is you are trying to add the same data twice. So it comes back with an error. It wont return a query when inserting data so you probably didnt notice it, but the data was added. Assuming that nothing happened, like i did lol, you press it again and this time it returns the error saying that the data can not be added because it is not UNIQUE.