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.

mo aly
7,003 Pointsstuck in stage 6 intro to databases challenge 3 task 3
my answer was ALTER TABLE t_movies ADD COLUMN fk_genre_id INTEGER NULL, CONSTRAINT FOREIGN KEY fk_genre_id REFERENCES t_genres(pk_id);

mo aly
7,003 PointsAlter the "t_movies" table to add a foreign key called "fk_genre_id" and constrain it to reference the "t_genres" "pk_id".
2 Answers

Gloria Dwomoh
13,104 PointsThe problem is the syntax also you have to use "ADD CONSTRAINT" try to have a look at the syntax.

mo aly
7,003 PointsAlter the "t_movies" table to add a foreign key called "fk_genre_id" and constrain it to reference the "t_genres" "pk_id".
Gloria Dwomoh
13,104 PointsGloria Dwomoh
13,104 PointsCan you link the challenge and/or question?