13) Display the first name of one customer and the last name of another customer where the first initial of the first name is the same as the first initial of the last name (Hint: cross join): first_name last_name Barry Brown Gary Goldstein Heather Hernandez Erin Esway
Added by Carlos E.
Close
Step 1
2) Show more…
Show all steps
Your feedback will help us improve your experience
Neel Patel and 72 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
Using MySQL, write a query to List all customers who spent 25% or less than the average amount spent on all invoices. For each customer, display their name and the amount spent to 6 decimal places. Order the result by the amount spent from high to low.. There are two tables in the database: 1) customer 2) invoice Example: customer id | customer_name | city_id | customer_address | contact_person | email | phone 1 | Drogerie Wien | 1 | Deckergasse 15A | Emil Steinbach | emil@drogeriewien.com | 094234234 2 | Cosmetics Store | 4 | Watling Street 347 | Jeremy Corbyn | jeremy@c-store.org | 093923923 3 | Kosmetikstudio | 3 | Rothenbaumchaussee 53 | Willy Brandt | willy@kosmetikstudio.com | 0941562222 4 | Neue Kosmetik | 1 | Karlsplatz 2 | NULL | info@neuekosmetik.com | 094109253 5 | Bio Kosmetik | 2 | Motzstraße 23 | Clara Zetkin | clara@biokosmetik.org | 093825825 6 | K-Wien | 1 | Kärntner Straße 204 | Maria Rauch-Kallat | maria@kwien.org | 093427002 7 | Natural Cosmetics | 4 | Clerkenwell Road 14B | Glenda Jackson | glena.j@natural-cosmetics.com | 093555123 8 | Kosmetik Plus | 2 | Unter den Linden 1 | Angela Merkel | angela@k-plus.com | 094727727 9 | New Line Cosmetics | 4 | Devonshire Street 92 | Oliver Cromwell | oliver@nlc.org | 093202404 invoice id | invoice_number | customer_id | user_account_id | total_price 1 | in_25181b07ba800c8d2fc967fe991807d9 | 7 | 4 | 1436 2 | 8fba0000fd456b27502b9f81e9d52481 | 9 | 2 | 1000 3 | 3b6638118246b6bcfd3dfcd9be487599 | 3 | 2 | 360 4 | dfe7f0a01a682196cac0120a9adbb550 | 5 | 2 | 1675 5 | 2a24cc2ad4440d698878a0a1a71f70fa | 6 | 2 | 9500 6 | cbd304872ca6257716bcab8fc43204d7 | 4 | 2 | 150 Expected Output 1 Kosmetikstudio 360.000000 2 Neue Kosmetik 150.000000
Madhur L.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD