Rebecca Smallwood
CS 80
Lab 22

Question 22.5

a) SELECT * FROM Authors
b) SELECT * FROM Publishers
c) SELECT AuthorID, Title, YearPublished, ISBN FROM Titles, AuthorISBN WHERE AuthorID = 2 AND AuthorsISBN.ISBN = Titles.ISBN ORDER BY Title ASC
d) SELECT Title, YearPublished, ISBN FROM Titles WHERE PublisherID = 1 ORDER BY Title ASC

Question 22.6

a) INSERT INTO Authors (AuthorID, FirstName, LastName, YearBorn) values ("5", "Stephen", "King", "1954")
b) INSERT INTO Titles (ISBN, Title, EditionNumber, YearPublished, PublisherID) values ("123456890", "I hate this Deitel book", "1", "2004", "1")
   INSERT INTO AuthorISBN (ISBN, AuthorID) values ("123456890", "3")
c) INSERT INTO Publishers (PublisherID, PublisherName) values ("3", "Bantam")

I really think that the questions in the Deitel book are not very clear at all. Take 
question 22.5a -- it says "Select all authors from the Authors table" -- does that mean 
select all _columns_ and rows? Does it just want the first name and last name? Or look at 
question 22.5d -- it says "Select a specific publisher and list all books published by that 
publisher." Is it wanting me to do a join between the Publishers and Titles tables, or do 
what I ultimately ended up doing -- just picking one of the PublisherID's and printing out 
the titles based on that? I find myself frustrated because sometimes the questions are 
not explicit enough in what they're asking for, for me to feel that I'm answering it correctly.