Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please solve this with sql thank you :) 1 1. Display the customer id, customer name, email address, and the phone number for all customers

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedplease solve this with sql thank you :)

1 1. Display the customer id, customer name, email address, and the phone number for all customers with the credit limit less than 200. Sort the result by customer ID. CUSTOMER_ID NAME EMAIL PHONE 1 Raytheon flor.stone@raytheon.com +1 317 123 4104 2 2 Plains GP Holdings lavera.emerson@plainsallamerican.com +1 317 123 4111 3 3 US Foods Holding fern.head@usfoods.com +1 812 123 4115 4 AbbVie shyla.ortiz@abbvie.com +1 317 123 4126 5 5 Centene jeni.levy@centene.com +1 812 123 4129 6 6 Community Health Systems matthias.hannah@chs.net +1 219 123 4136 7 7 Alcoa matthias.cruise@alcoa.com +1 219 123 4138 8 8 International Paper neenakshi.mason@internationalpaper.com +1 317 123 4141 9 Emerson Electric christian.cage@emerson.com +1 219 123 4142 10 262 MGM Resorts International peter.gamble@mgmresorts.com +39 49 012 4411 11 263 Farmers Insurance Exchange nathan.callahan@farmers.com +39 10 012 4413 4 9 2. Display the warehouse id, warehouse name, and the warehouse city for warehouses located in cities where city name starts with letter 'S' or 'T'. o Sort the output by city name. 1 un WN WAREHOUSE_ID WAREHOUSE_NAME 13 CITY 4 Seattle, Washington Seattle 3 New Jersey South Brunswick 2 San Francisco South San Francisco 1 Southlake, Texas Southlake 6 Sydney Sydney 4 5 5 6 Sydney 5 Toronto Sydney Toronto 6 3. Write a SQL statement to display product ID, product name, category ID, category name, and list price for the following products: Include products whose list price is less than $30. Include also products whose list price is greater than $4000. Sort the result by product ID. 1 2 3 4 PRODUCT_ID PRODUCT_NAME 50 Intel SSDPECME0401401 56 Western Digital WD2500AAJS 94 Western Digital WD2500AVVS 133 PNY VCQP6000-PB 206 PNY VCQM6000-24GB-PB 256 Western Digital WD5000AACS CATEGORY_ID CATEGORY_NAME LIST_PRICE 5 Storage 8867.99 5 Storage 16.99 5 Storage 15.55 2 Video Card 5508.99 2 Video Card 4148 5 Storage 26.99 5 6 4. Write a SQL statement to display products in category 2 that have not been sold in any orders. Sort the result by product ID. Display the result exactly the same as the given output STATUS 1 88 has not been sold. 2 133 has not been sold. 3 161 has not been sold. 4 175 has not been sold. 5 221 has not been sold. 6223 has not been sold. 7267 has not been sold. 5. Display the product id, product name, warehouse id, warehouse name, and the quantity of products for all warehouses with the product quantity greater than 300. Sort the result by product ID. PRODUCT_ID PRODUCT_NAME 1 270 Gigabyte GV-N1070WF2OC-8GD 2 269 Zotac ZT-P10810D-10P 3 284 Kingston SA400S37/120G 4 284 Kingston SA400S37/120G WAREHOUSE_ID WAREHOUSE_NAME QUANTITY 3 New Jersey 304 3 New Jersey 304 6 Sydney 320 2 San Francisco 353 6. Create a view named customer_report to display customer ID, customer name, and order ID, order date, and order status for customers who have cancelled their orders. 7. Write a SQL statement to display the result of the customer_report view. Sort the output based on the customer number. . Show orders that are placed after January 31, 2017. Sort the result by product ID from high to low. 2 CUSTOMER ID NAME 46 Supervalu 45 CenturyLink 44 Jabil Circuit 6 Community Health Systems 5 Centene ORDER_ID ORDER_DATE STATUS 31 12-AUG-17 Canceled 7021-FEB-17 Canceled 69 17-MAR-17 Canceled 28 15-AUG-17 Canceled 5 09-APR-17 Canceled 3 4 5 8. Modify the customer_report view to display also customers who do not have any orders. 9. Using the customer_report view, show customer number and customer name for customers who do not have any orders and their name starts with letter 'V'. Sort the output result according to the customer number from high to low. 1 2 3 4 5 CUSTOMER_ID NAME 291 Voya Financial 268 VF 244 Viacom 234 Visa 122 Valero Energy 100 Verizon 46 Supervalu 45 CenturyLink 44 Jabil Circuit 6 Community Health Systems 5 Centene ORDER_ID ORDER_DATE STATUS (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) 3112-AUG-17 Canceled 7021-FEB-17 Canceled 69 17-MAR-17 Canceled 2815-AUG-17 Canceled 5 09-APR-17 Canceled 6 7 8 9 10 11 10. Write a SQL statement to delete the customer_report view

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions