Hello,
I am just getting my feet wet w/MYSQL. I am going through a MYSQL tutorial in the book 'Internet and to program' by Deitel & Deitel. I am trying to an insert and have my data, such as the foreign keys also get automatically updated. But I am not having any success as of yet. I have this simple db called books. In books:
Publishers
PublisherID (Primary Key) that is a foreign key in Titles and PublisherName
--
Titles
ISBN (Primary Key) that is a foreign key in AuthorISBN, Title, EditionNumber,YearPublished,Description,PublisherID
--
AuthorISBN just a look-up table that links Titles and Authors together. It has ISBN and AuthorID.
--
Authors
AuthorID (Primary Key) that is foreign key to AuthorISBN,
FirstName, LastName,YearBorn.
----
I am trying to add a new title for an author, but also want the AuthorISBN table to get updated as well and the Publisher. I thought that this would happen automatically because I linked the tables togther when I created the DB.
Here's my sql statement:
any help would be greatly appreciated. Thanks in advance,
Kelly
I am just getting my feet wet w/MYSQL. I am going through a MYSQL tutorial in the book 'Internet and to program' by Deitel & Deitel. I am trying to an insert and have my data, such as the foreign keys also get automatically updated. But I am not having any success as of yet. I have this simple db called books. In books:
Publishers
PublisherID (Primary Key) that is a foreign key in Titles and PublisherName
--
Titles
ISBN (Primary Key) that is a foreign key in AuthorISBN, Title, EditionNumber,YearPublished,Description,PublisherID
--
AuthorISBN just a look-up table that links Titles and Authors together. It has ISBN and AuthorID.
--
Authors
AuthorID (Primary Key) that is foreign key to AuthorISBN,
FirstName, LastName,YearBorn.
----
I am trying to add a new title for an author, but also want the AuthorISBN table to get updated as well and the Publisher. I thought that this would happen automatically because I linked the tables togther when I created the DB.
Here's my sql statement:
Code:
insert into Titles(ISBN, Title, EditionNumber, YearPublished, Description,
PublisherID) values ('0-88-010671-2','Brace: How to Program', 1, 2003, 'damn good book',3 );
Kelly