Question: command coming out wrong mysql> mysql> mysql> alter table songs add foreign key(artist_id) references artist(id); ERROR 1452 (23000): Cannot add or update a child row:
command coming out wrong
mysql> mysql> mysql> alter table songs add foreign key(artist_id) references artist(id); ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (music. #sql-5b_10, COM EFERENCES'artist' ('id')) mysql>
Step by Step Solution
There are 3 Steps involved in it
It looks like you are attempting to add a foreign key constraint to the songs table that references the id column in the artist table but youre encoun... View full answer
Get step-by-step solutions from verified subject matter experts
