Check foreign key constraints

To check the foreign key constraints, execute the "show create table" command and check "CONSTRAINT ~ FOREIGN KEY".

show create table book;

This is a sample output result. You can see that the foreign key constraint is set.

CREATE TABLE `book` (
   ...
   CONSTRAINT `book_ibfk_1` FOREIGN KEY (`author_id`) REFERENCES `author` (`id`),
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4

Associated Information