Question: Customer Table: Orders Table: Orderline Table: Parts Table: Salesrep Table: Answer all the questions with query sql code: 1)Find the customer number, last name, first
Customer Table:
Orders Table:
Orderline Table:
Parts Table:
Salesrep Table:

Answer all the questions with query sql code:
1)Find the customer number, last name, first name, current balance, and sales rep number of every customer whose balance is larger than the balance of at least one customer of sales rep number 12.
2)List the customer number, last name, first name, and balance of each customer whose balance is greater than the average balance of all customers.
3)Show the customer number for every customer who does not have a sales rep assigned yet.
4)List the warehouse number and the number of different parts stored in each warehouse, only include those warehouse with more than 2 different parts.
5)List the full name and mailing address of customers who placed an order on 04-AUG-2013. If the same customer has placed more than one order on this day, only show his/her information once.
C_NUMBER CLAST CFIRST STREET CITY STATE ZIP CODE BALANCE CREDIT_LIMIT SLSREP_NUMBER 124 Adams Sally 418 Oak Lansing MI 49224 818.75 1000 3 256 Samuels Ann 215 Pete Grant MI 49219 21.5 1500 6 311 Charles Don 48 College Tra MI 49034 825.75 1000 12 315 Daniels Tom 914 Cherry Kent MI 48391 770.75 750 6 405 Williams AL 519 Watson Grant MI 49219 402.75 1500 12 412 Adams Sally 16 Elm Lansing MI 49224 1817.75 2000 3 522 Nelson Mary 108 Pine Ada MI 49441 98.75 1500 - 567 Dinh Tran 808 Ridge Harper MI 48421 402.4 750 6 587 Galvez Mara 512 Pine Ada MI 49441 114.6 1000 6 622 Martin Dan 419 Chip Grant MI 49219 1045.75 1000 3 EDIT ORDER NUMBER ORDER_DATE C_NUMBER 12489 02-Aug-2013 124 12491 02-Aug-2013 311 12494 04-Aug-2013 315 12495 04-Aug-2013 256 12498 05-Aug-2013 522 12500 05-Aug-2013 124 12504 05-Aug-2013 522 ORDER NUMBER PART NUMBER NUMBER ORDERED QUOTED PRICE 12489 AX12 11 21.95 12491 BT04 1 149.99 12491 BZ66 1 399.99 12494 CB03 4 279.99 12495 CX11 2 22.95 12498 AZ52 2 12.95 12498 BA74 4 24.95 12500 BT04 3 149.99 12504 CZ81 2 325.99 PART NUMBER PART_DESCRIPTION UNITS_ON_HAND ITEM_CLASS WAREHOUSE NUMBER UNIT_PRICE AX12 Iron 104 HW 3 24.95 AZ52 Dartboard 20 SG 2 12.95 BA74 Basketball 40 SG 1 29.95 BH22 Cornpopper 95 HW 3 24.95 BT04 Gas Grill 11 AP 2 149.99 BZ66 Washer 52 AP 3 399.99 CA14 Griddle 78 HW 3 39.99 CB03 Bike 44 SG 1 299.99 CX11 Blender 112 HW 3 22.95 CZ81 Treadmill 68 SG 2 349.95 SLSREP_NUMBER SRLAST SRFIRST STREET CITY STATE ZIP CODE TOTAL COMMISSION COMMISSION_RATE 3 Jones Mary 123 Main Grant MI 42919 2150 .05 4 Morton Tom 300 College Flint MI 49227 2075 .06 6 Smith William 102 Raymond Ada MI 49441 4912.5 07 12 Diaz Miguel 419 Harper Lansing MI 49224 2150 05Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
