Question

Write just one SQL statement per question 1. Display Publisher ID, Publisher Name and Total Number...

Write just one SQL statement per question

1. Display Publisher ID, Publisher Name and Total Number of Books published by each publisher. 2. List Publisher ID, Publisher Name, Title and price of the highest priced book. 3. List Order ID, Customer ID, Order Date, and Number of Items in each order. Order the data by Customer ID in ascending (A – Z) order. 4. Display Title, Category and Profit for each book in the children and computer category. 5. Display Last Name & First Name of Authors who has the same last name of a Customer. 5.Display ShipCity, ShipState and Total Sales. Determine ShipCity and ShipState with Lowest total Sales [Total Sales = SUM(QUANTITY*Retail)].

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.SELECT Publisher_ID,Publisher_Name,Books FROM Publisher GROUP BY Publisher;
2.SELECT Publisher_ID,Publisher_Name,Title,price WHERE price IN(SELECT MAX(price) FROM Publisher);
3.SELECT Order_ID,Customer_ID,Order_Date,Number_Of_Items FROM Order ORDER BY Customer_ID ASC;
4.SELECT Title,Category,Profit FROM Book WHERE Category= "Children" OR Category="Computer" GROUP BY Category;
5.SELECT LastName,FirstName FROM Author WHERE LastName IN (SELECT LastName FROM Customer);
6.SELECT ShipCity,ShipState,TotalState FROM Ship WHERE TotalSales IN (SELECT MIN(SUM(QUANTITY*Retail)) FROM Ship);

Add a comment
Know the answer?
Add Answer to:
Write just one SQL statement per question 1. Display Publisher ID, Publisher Name and Total Number...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please help me on the SQL queries, thank you so much. Write a query to display the title and publisher as well as the p...

    Please help me on the SQL queries, thank you so much. Write a query to display the title and publisher as well as the publisher contact for each book using JOIN...USING clause. Write a query to show the first and last names of customers who have ordered cooking books. Use the WHERE clause to join the tables. Write a query to show the title, cost and ISBN of each book in the books table. If the book has been ordered,...

  • Write a query to display author ID, author first, last name, and the number of subjects...

    Write a query to display author ID, author first, last name, and the number of subjects (book subject count) for authors who have published books in more than one subject area (book subject). CHECKOUT PATRON PK Pat ID FK1 Book Num FK2 Pat ID Check Out Date Check Due Date Check In Date Pat FName Pat LName Pat Type BOOK AUTHOR PK Au ID Book Title Book Year Book Cost Book Subject Au FName Au LName Au BirthYear FK1 Pat...

  • Write the following SQL statements in Microsoft Access by using the Books database from Week 2...

    Write the following SQL statements in Microsoft Access by using the Books database from Week 2 Assignment 2. Once complete, copy and paste the SQL statements in a Microsoft Word document: Write SQL statements: To update the publisher name from READ WITH US to READ FOR US To verify the updated name field for the publisher with ID 6 To make the following updates to the Publisher table (be careful with WHERE): Make Contact="John Travolta" for publisher with ID number...

  • In MySQL: - Display the Editors’ first and last name, as well as the Book’s title...

    In MySQL: - Display the Editors’ first and last name, as well as the Book’s title sorted by Book’s title first and the Editor’s last name second for all Books that were published on September 26, 2006. - Display the Author’s first and last name, as well as their ID, and the Book title and number of pages for all of the books they have written that have more than the average number of pages for all of the books...

  • Given the following table structure, write the SQL code to display all the first and last...

    Given the following table structure, write the SQL code to display all the first and last names of the individuals that have a last name that begins with the letter 'M! CREATE TABLE Persons Personi int LastName varchar(80). FirstName varchar(80). Address varchar(125). State char(2) Given the following table structure, write the SQL code to display all the first and last names of the individuals that have a last name that does not contain the letter 'S: CREATE TABLE Persons PersonlDint,...

  • This assignment consists of a series of SQL questions. For each question, you will need to...

    This assignment consists of a series of SQL questions. For each question, you will need to include: • SQL query. • An explanation of the query. Please include explanations as a comment AFTER your query, e.g., enclosed within a /* comments block */ ). See the first example in the SQL tutorial for a comment. You don’t need to explain straightforward code in comments. Only the parts that are interesting or different, so that we understand what you did. Question-1...

  • SQL Homework 1. For each reservation, list the reservation ID, trip ID, customer number, and customer...

    SQL Homework 1. For each reservation, list the reservation ID, trip ID, customer number, and customer last name. Order the results by customer last name. 2. For each reservation for customer Ryan Goff, list the reservation ID, trip ID, and number of persons. 3. List the trip name of each trip that has Miles Abrams as a guide. 4. List the trip name of each trip that has the type Biking and that has Rita Boyers as a guide. 5....

  • I need to write a SQL query that displays the first name and last name of...

    I need to write a SQL query that displays the first name and last name of each author along with the number of books he or she has written. Capitalize the first and last names. AUTHOR table: AUTHORID, LNAME, FNAME BOOKAUTHOR table: ISBN, AUTHORID BOOKS table: ISBN, TITLE, PUBDATE, PUBID, COST, RETAIL, DISCOUNT, CATEGORY

  • Write an SQL statement that will display the Employee ID, First name (only last 2 letters),...

    Write an SQL statement that will display the Employee ID, First name (only last 2 letters), phone number (replace . by /) of all employees whose job Id has a word ‘REP’.

  • need a solution/explanation for this SQL problem. 7. Display a list of customer names with furniture series that purchased more than twice by this customer. Also, display the number of times of purcha...

    need a solution/explanation for this SQL problem. 7. Display a list of customer names with furniture series that purchased more than twice by this customer. Also, display the number of times of purchase. 8. Display a list of furniture series that are priced above the average of all other series. 9. Display the customer ID of the the customers, the series and price of the most expensive furniture they purchased. Sort the result by customer ID in ascending order CUSTOMER...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT