Answers for "foreign key constraint fails while inserting new data in mysql"

SQL
3

fk in insert mysql

INSERT INTO joke(joke_text, joke_date, author_id)
VALUES (‘Humpty Dumpty had a great fall.’, ‘1899–03–13’, 
        (SELECT id FROM author WHERE author_name = ‘Famous Anthony’));
Posted by: Guest on November-17-2020
1

mysql foreign key constraints

ALTER TABLE Orders ADD CONSTRAINT FK_PersonOrder FOREIGN KEY (PersonID) REFERENCES Persons(PersonID);
Posted by: Guest on May-22-2021

Code answers related to "foreign key constraint fails while inserting new data in mysql"

Code answers related to "SQL"

Browse Popular Code Answers by Language