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.

Development Tools Database Foundations Joining Relational Data Between Tables in SQL Keys and Auto-Incrementing Values

Daniel Schwemmlein
Daniel Schwemmlein
4,960 Points

don't know whats missing in my constraint

Hello! I guess there is something missing in my syntax or there is something not correct. please help me because I don't know what else could still be missing here

I was supposed to add a foreign table and then make a constraint with two other things

thanks in advance

Could you list the tables you are working with? Could you list your script here?

Daniel Schwemmlein
Daniel Schwemmlein
4,960 Points

So i was supposed to alter the table t_movies by adding the fk_genre_id as a foreign key and have t_genres and Pk_id as references:

This is what i have currently

alter table t_movies add column fk_genre_id integer constraint foreign key(fk_genre_id) references (t_genres, pk_id);