Question: For each question write the question, SQL script and the output. Include all three in a notepad or word document. Do not include screen shots.

For each question write the question, SQL script and the output. Include all three in a notepad or word document.  Do not include screen shots. Know how to cut and paste from the SQLplus screen.

customers

custIDcustLNamecustFNameDateofBirthcustCity
C1AttenweilerShannon10-Jul-1987Florence
C2MarksburyFaisal25-Dec-1965Blue Ash
C3O'ConnellJoseph12-Feb-1976West Chester
C4OwenMeghan11-Mar-1982Loveland
C5SullivanSean19-Nov-1981Batavia
C6WeaverJohn21-Jan-1963Dayton
C7AlghanemKelli22-Apr-1972Newport
C8BallhausWilliam6-Oct-1977Fort Thomas

 

Orders

orderIDorderDateAmountcustID
11111-Mar-2013234.45C1
11211-Mar-2013962.89C3
11312-Mar-2013734.46C4
11413-Mar-2013393.76C5
11513-Mar-2013314.34C2
11613-Mar-2013733.23C4
11716-Mar-2013678.89C1
11816-Mar-2013895.34C6
11916-Mar-2013232.64C6
12016-Mar-2013723.29C8
12117-Mar-2013278.34C3
12217-Mar-2013123.45C6
12317-Mar-2013673.45C4
12418-Mar-2013312.35C2
12519-Mar-2013863.34C5
12619-Mar-2013123.45C3
12719-Mar-2013965.76C1

 

Questions: 

  1. List the total number of orders for placed from each city.
  2. List the total value (amount) for each customer.
  3. List all the orders (ordered, order date, amount) along with customer details (customer name and city).
  4. List the customer's name with least total amount of orders.
  5. List the youngest customer.
  6. List the number of days past each order.

Step by Step Solution

3.44 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here are SQL queries for each of your questions along with the expected outputs Question 1 List the total number of orders placed from each city sql SELECT ccustCity COUNToorderID AS TotalOrders FROM ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!