General Directions:Write INSERT statements to add a new record to each of the ta
ID: 3646567 • Letter: G
Question
General Directions:Write INSERT statements to add a new record to each of the tables in the Books database. Add a new publisher who is the publisher for a new book written by a new author. That book should be ordered by the new customer you are adding.Create SQL statements for the following.
Write INSERT statements to add a new record to each of the tables in the Books database with the following requirements:
1.Add a new publisher who is the publisher for a
new book written by a new author. That book should be
ordered by the new customer you are adding.
Explanation / Answer
It's difficult to do this without knowing what the tables in your books database are, but here's an example. INSERT INTO Books.Publishers VALUES ("Ma & Pops Publishing Co"); INSERT INTO Books.Customers VALUES ("Jones","Paul","paul.jones@gmail.com"); INSERT INTO Books.Authors VALUES ("Reed","Jonathan") Create the new book: INSERT INTO Books.Titles VALUES ("The American Story",(Select ID from Authors where fName = "Jonathan" AND lName = "Reed")) Order the new book for the new customer INSERT INTO Books.Orders VALUES ((Select ID from Customers where email="paul.jones@gmail.com"), (select ID from Titles where title="The American Story")) Again, this will need tweaking since I have no idea what your table/column definitions are.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.