I need to open table that represents what owner adopted what animal (the relation is one to many). I start with foreign keys and some columns but after I try to open that table, I get an error
This is the question from my test:
- Primary Key is the combination of both
pet table. must be unique.
- other columns:
This is the script I made
CREATE TABLE `pet shelter`.`adoption` ( `adoption_date` INT NULL, CONSTRAINT `owner_id` FOREIGN KEY () REFERENCES `pet shelter`.`owner` () ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `pet_id` FOREIGN KEY () REFERENCES `pet shelter`.`pet` () ON DELETE CASCADE ON UPDATE CASCADE);
But I get this error:
Operation failed: There was an error while applying the SQL script to the database.
ERROR 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') REFERENCES `pet shelter`.`owner` () ON DELETE NO ACTION ON UPDATE ' at line 4