Computer Science Homework Solutions
Problem
#23230

SQL Commands

Use SQL to complete the following:

For each type of book, list the type and the average price.  There are several BOOKs in each type.

See attachement file for details.

This is what I was doing in MYSQL but it isn't working and any suggestion would be greatly appreciated. I keep getting error messages.  This is definitely not the correct way.

Attached file(s):
Attachments
SQL 1.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.)

SQL 1.doc
Use SQL to complete the following:

For each type of book, list the type and the average price. There are
several BOOKs in each type.

For example, this is what it should look like:

TYPE AVG(PRICE)

TRA 10.50

SFI 11.25

SCI 5.50

PSY 21.25

POE 16.50

PHI 8.00

MYS 17.20

HOR 12.28

HIS 12.00

FIC 18.50

CMP 10.00

ART 30.25



This is what I was doing in MYSQL but it isn’t working and any
suggestion would be greatly appreciated. I keep getting error messages.
This is definitely not the correct way.

SELECT DISTINCT TYPE

FROM BOOK

WHERE TYPE IN (SELECT AVG(PRICE)

FROM BOOK

;
Solution
What is this?
By OTA - Overall OTA Rating
Jane Chen, MSc - 5/5
Purchase Cost Now
$2.19 CAD (was ~$3.99)
Included in Download
  • Plain text response
  • Attached file(s):
    • SQL 1.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
  • 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 ...
  • 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. ...
  • 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 ...
  • C and Shell Programming Language - Can anyone help me explain the difference between a C and a SHELL programming language? Thank you so much!
Browse