Computer Science Homework Solutions
Problem
#23455

SQL Commands

See attach file for details and charts.

1.  Define a view named CustOrder.  It consists of the customer number, name, balance, order number, and order date for all orders currently on file.  Explain how you would use SQL to obtain the desired results. Display the data in the view.

2.  Create a view named OrdTot.  It consists of the order number and order total for each order currently on file.  (The order total is the sum of the number ordered multiplied by the quoted price on each order line for each order.)  Explain how you would use SQL to obtain the desired results. Display the data in the view.

Attached file(s):
Attachments
Figure 2.doc  View File

Attachment Content Summary (Note: view attachment at the above link before purchasing. Actual attachment content may vary slightly from that shown below.)

Figure 2.doc
Rep_Num Last_Name First_Name Street City State Zip Commission Rate

20 Kaiser Valerie 624 Randall Grove FL 33321 $20,542.50 0.05

35 Hull Richard 532 Jackson Sheldon FL 33553 $39,216.00 0.07

65 Perez Juan 1626 Taylor Fillmore FL 33336 $23,487.00 0.05

Premiere Products Database

Table: Rep

Table: Customer

CustomerNum CustomerName Street City State Zip Balance CreditLimit

148 Al’s Appliance and Sport 2837 Greenway Filmore FL 33336 $6,550.00
$7,500.00

282 Brookings Direct 3827 Devon Grove FL 33321 $431.50 $10,000.00



Table: Orders

OrderNum OrderDate CustomerNum

21608 10/20/2003 148

21610 10/20/2003 356

21613 10/21/2003 408

21614 10/21/2003 282



Table: OrderLine

OrderNum PartNum NumOrdered QuotedPrice

21608 AT94 11 $21.95

21610 DR93 1 $495.00

21610 DW11 1 $399.99

21613 KL62 4 $329.95

21614 KT03 2 $595.00



Table: Part

PartNum Description OnHand Class Warehouse Price

AT94 Iron 50 HW 3 $24.95

BV06 Home Gym 45 SG 2 $794.95

CD52 Microwave Oven 32 AP 1 $165.00

DL71 Cordless Drill 21 HW 3 $129.95

1. Define a view named CustOrder. It consists of the customer number,
name, balance, order number, and order date for all orders currently on
file. Explain how you would use SQL to obtain the desired results.
Display the data in the view.

2. Create a view named OrdTot. It consists of the order number and
order total for each order currently on file. (The order total is the
sum of the number ordered multiplied by the quoted price on each order
line for each order.) Explain how you would use SQL to obtain the
desired results. Display the data in the view.
Solution
What is this?
By OTA - Overall OTA Rating
Suraj Joshi, PhD (IP) - 4.7/5
Purchase Cost Now
$2.19 CAD (was ~$7.98)
Included in Download
  • Plain text response
  • Attached file(s):
    • a.doc
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
  • corrections to code. - The other objective is to create a table called balance that includes the customer ID, last name, first name, and the customer's total balance (the sum of price for all orders). Study the tables below ...
  • Ls, cat, man, hexdump - Please assist with this assignment: 1. Practice the following commands on the Linux machine, and write a report on how you used them (screenshot will be fine): ls, cat, man, hexdump, xxd, dd, grep ...
  • Using Unix alias to emulate DoS commands - Assume you are an experienced DOS programmer and you want to write UNIX shell scripts using DOS commands. Use the alias command so you can type the follow DOS commands and perform UNIX functions: a ...
  • UNIX Commands - You have a file called records.txt containing the list of employee id and employee names. Every line contains a single employee id immediately followed by (that means no space) the employee name in th ...
  • Compute the processor savings in given situation, when using interrupt driven I/O instead of polled I/O. - In an 8-hour interval, an operator controls systems with 60 commands on the average, entered through a keyboard. a. Processor scans keyboard every 100 ms. Give check counts in an 8 hours period. b. ...
Browse