posted 14 years ago
What are the PK/FK columns of each table
Where is the bookcategory_id ? (ie which table)
Is there a BOOKS table and/or a BOOK table as the error message is for 'books' ?
If the PK on a table has multiple columns to uniquely identify a row then FKs back to the parent must also have the same information so the correct row can uniquely be identified.
The PK of books [id,bookcategory_id,author_id]) seems to be overdone - should only be id (assuming this is unique) whether this a DB sequence number or the book's ISBN. Author and book category combination would normally not be considered to be unique (an author will normally write more than one book in a particular category)
Also I would think that the BOOK would have a FK back to the PUBLISHER table rather than the other way around as a Publisher willl publish more than one book but a book, at least an edition of a book, will only have one publisher.