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 trialmo 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,116 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,116 PointsGloria Dwomoh
13,116 PointsCan you link the challenge and/or question?