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)].
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);
Write just one SQL statement per question 1. Display Publisher ID, Publisher Name and Total Number...
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 (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 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...
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 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 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....
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 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...
Need MySql commands for Use a UNION statement. Display the address ID, address, and district from the address table where the district is California or Alberta. Display the address ID, address, and district only from the address table where the address contains Jol. Display the language ID and name from the language table and the film ID from the film table. Display all languages whether they have an associated film or not. Order results by language ID in ascending order....
Author(name, address, URL) Book(ISBN, title, year, price, publisher_Name) WrittenBy(name, address, ISBN) Publisher(name, address, phone, URL) Warehouse(code, phone, address) Stocks(ISBN, WH_code, number) Shopping-Basket(basketID, email) basketContains(ISBN, basketID, number) Customer(email, name, address, phone) Referring to the relational model in slide 15 in"ER-mapping" (about author, publisher, shopping-basket, provide the algebraic pressing for the following queries Q1: Report the book title, and year for the books that have been written by exactly 2 authors, one of them is Mark Smith" Q2: For each customer,...