Added foreign key constraints and tested it successfully.