Write a script with the necessary formatting commands (e.g. COLUMN, BREAK, TTITLE, etc.) and an SQL statement to create a report that lists each customer number, each order number he/she placed, the total value of each order, the sum of the total values of all the orders for each customer, and the grand total of all the orders placed by all customers under the following heading:
Orders Total Values
Page: xx
Customer Order Total
No No Value
Given the following schema of a database table:
Orders(orderNo, dateDue, totalValue, status, custNo)
where: custNo is the number of the customer who placed the order.
COLUMN custNo FORMAT A10 HEADING 'Customer | No'
COLUMN orderNo FORMAT A8 HEADING 'Order | No'
COLUMN totalValue FORMAT L99999.99 HEADING 'Total | Value'
SET UNDERLINE =
BREAK ON custNo SKIP 1 ON Report skip 2
COMPUTE SUM OF totalValue on custNo
COMPUTE SUM OF totalValue on Report
TTITLE CENTER 'Orders Total Value' SKIP 1 -
Right ' Page: ' FORMAT 999 sql.pno SKIP1
SELECT custNo, orderNo, totalValue
FROM Orders
ORDER BY custNo, orderNo;
You might also like to view...
The range of valid index values for an array name runs from 0...name.length.
Answer the following statement true (T) or false (F)
The standard for connecting an ATM network to a user is the
a. NNI b. UNI c. DDS d. none of the above
The Database Splitter is not identified by name on the Access Ribbon
Indicate whether the statement is true or false
Going beyond the surface structure to find the deep structure of a situation involves:
a) Going beyond the initial case description to look for additional issues b) Examining possible interconnections between the presenting issues c) Examining your own assumptions that you might be making about the case d) All of the above