Hands-On Assignments To perform these assignments, refer to the tables in the JustLee Books database. Use a subquery to accomplish each task. Make sure you execute the query you plan to use as the subquery to verify the results before writing the entire query. 1. List the book title and retail price for all books with a retail price lower than the average retail price of all books sold by JustLee Books. 2. Determine which books cost less than the average cost of other books in the same category. 3. Determine which orders were shipped to the same state as order 1014. 4. Determine which orders had a higher total amount due than order 1008. 5. Determine which author or authors wrote the books most frequently purchased by customers of JustLee Books. 6. List the title of all books in the same category as books previously purchased by customer 1007. Don't include books this customer has already purchased. 7. List the shipping city and state for the order that had the longest shipping delay. 8. Determine which customers placed orders for the least expensive book (in terms of regular retail price) carried by JustLee Books. 9. Determine the number of different customers who have placed an order for books written or cowritten by James Austin. 10. Determine which books were published by the publisher of The Wok Way to Cook.
Added by Ricardo P.
Close
Step 1
``` SELECT title, retail_price FROM books WHERE retail_price < (SELECT AVG(retail_price) FROM books); ``` Show more…
Show all steps
Your feedback will help us improve your experience
Liliane Martins and 61 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Akash M.
Please help me with these SQL queries 1. Give a list of customers (IDs and names) who have purchased multiple items, but all of which were the same color. Multiple items means more than one sale item. Use what you learned in the previous problem about counting colors. 2. Give a list of products and their list prices for sneakers whose list price is less than the average for flats. Only show product names and prices. 3. What is the most expensive sale item (SalePrice * Quantity) ever made and to whom was it made (first and last name)? Name the column LargestItemSale. (Use a max subquery in the WHERE clause.) Manufacturer: - ManufacturerID - ManufacturerName - Address1 - Address2 - City - State - PostalCode - Country - Phone - Fax - Contact - URL Customer: - CustomerID - FirstName - LastName - StreetAddress - City - State - PostalCode - Country - Phone Product: - ManufacturerID - ProductID - ProductName - Composition - ListPrice - PostalCode - Gender - Category - Color - Description - Phone - Fax - Contact - URL SaleItem: - SaleID - ProductID - ItemSize - SaleID - Quantity - SalePrice InventoryItem: - ProductID - ItemSize - QtyOnHand PurchaseItem: - ProductID - ItemSize - PurchaseID - Quantity - PurchasePrice Sale: - SaleID - SaleDate - CustomerID Purchase: - PurchaseID - PurchaseDate - EmployeeID - ExpectedDeliveryDate - ManufacturerID - Shipping Employee: - EmployeeID - FirstName - LastName - Address - City - State - ZIP - Phone - ManagerID - SSN - EmailAddress - HireDate Shipping: - ShippingID - EmployeeID - ShippingDate SalaryEmployee: - EmployeeID - Salary WageEmployee: - EmployeeID - Wage - MaxHours
oracle 12C: SQL Chapter Eight Textbook Assignment 1. List all customers that live in Massachusetts or California. Show the first and last names together in the same column, then city, then state. There will be three (3) columns in your report with data looking like this: Tom Yates Dallas TX Sort the results in ascending order by the last name within the state. Use appropriate column aliases for the headings. 2. Report all books published after Jan. 1st, 2015, as well as all books published in 2014 that have retail price of $50 or less. Show the title, publisher's number, retail price, and date published. The list should sort the data first by publisher number, then by retail price within each publisher. So you will have two sets of data in the report: all books published after January 1st, 2015 as well as those books published in 2014 that have retail price of $50 or less. 3. List titles, cost, retail and profit margin for all books that have a profit margin under 55%. Make sure to assign a descriptive column name for the calculated field. Profit margin is calculating by the following formula: ((retail – cost) / cost) *100
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD