I need to write the select statements for each of these and show results. 1. A u
ID: 3624587 • Letter: I
Question
I need to write the select statements for each of these and show results.1. A user needs to know which books were published by American Publishing.
2. List the customer first name, and last name as NAME, state, and Category for those customers who live in the state of Idaho or washington and have ordered books about cooking.
3. List the author first name and last name as authors and the book title as book titles that were sold in the state of wyoming. Sort the display on authors last name and then first name.
4. The author James Austin would like to send a thank you note to each customer that order a book that he helped write. Create a list of all customers that order books written by James Austin.
5. List the contact person as contact name, telephone number as Telephone and the authors first name and last name as Author Name. Sort the list on contact person in descending order.
Explanation / Answer
Books (Book_name, book_type, publisher
Custromer (FirstName, LastName, State Telephonenumber,contact person)
Orders (Book_ordered, book_name, order_no, book_type)
Select book_name from books where publisher = ‘American publishing’;
Select FirstName + ' ' + LastName from Employees ORDER BY FirstName ASC;
SELECT concat(FirstName,LastName) "Name" from Customers where state = ‘idaho’ or state = ‘washington’ and book_type = (select book_type from ordered where book_ordered = ‘cooking’);
Select name from customers, orders where book_name = (select book_name from orders where author = ‘James Austin’);
Select contact person as contact name, telephone number as telephone name, concat (FirstName,LastName) "Name" from customers, Books, ORDER BY contact person DESC;