Original Question was: (Which never was answered) 18.5 Write SQL queries for the
ID: 3534204 • Letter: O
Question
Original Question was: (Which never was answered)
18.5 Write SQL queries for the books database (discussed in Section 18.3) that perform each of the following tasks:
a. Select all authors from the Authors table with the columns in the order lastName, firstName and authorID.
b. Select a specific author and list all books for that author. Include the title, year and ISBN number. Order the information alphabetically by title.
c. Add a new author to the Authors table.
d. Add a new title for an author (remember that the book must have an entry in the AuthorISBN table).
18.3
Author ID Authors ID number in the database. In the books database, this integer column is defined as autoincremented-for each row inserted in this table, the author ID value is increased by 1 automatically to ensure that each row has a unique author ID. This column represents the tables primary Key.
FirstName Authors first name (a string)
LastName Authors Last Name (a String)
Author ID First Name Last Name
1 Paul Deitel
2 Harvey Deitel
3 Abbey Deitel
4 Michael Morgano
5 Eric Kern
Follow Up Question:
Correct each of the following SQL Statements that refer to the books database:
a) SELECT firstName FROM author WHERE authorID = 3
b) SELECT isbn, title, FROM Titles ORDER WITH title DESC
c) INSERT INTO Authors ( authorID, firstName, lastName ) VALUES ("2", "Jane", "Doe")
Explanation / Answer
a)SELECT Last Name, First Name,Author ID FROM Authors;
b)
c)INSERT INTO Authors ( Author ID, First Name, Last Name ) VALUES ("2", "Jane", "Doe");
d)INSERT INTO AuthorISBN(title)VALUES("abc");
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.