For every invoice, display the invoice number, invoice date and the total dollar amount for all products purchased in the invoice, ordered by invoice number in descending order and then by invoice date in ascending order. Here you will use an aggregate SUM(x,y) function in your SELECT clause to calculate the total dollar amount (a calculated field – name it TOTAL). Don’t forget to join on the tables as well. [hint: you should have 8 rows of output ordered properly]. My code is as follows: select inv_number, inv_date, sum(line_price) as 'total' from invoice, line where invoice.inv_number = line.inv_number order by inv_number desc, inv_date asc ;  I am getting this error: ORA-00923: FROM keyword not found where expected Any recommendations on what I am doing wrong?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

SQL:

For every invoice, display the invoice number, invoice date and the total dollar amount for all products purchased in the invoice, ordered by invoice number in descending order and then by invoice date in ascending order. Here you will use an aggregate SUM(x,y) function in your SELECT clause to calculate the total dollar amount (a calculated field – name it TOTAL). Don’t forget to join on the tables as well. [hint: you should have 8 rows of output ordered properly].

My code is as follows:

select inv_number, inv_date, sum(line_price) as 'total' from invoice, line where invoice.inv_number = line.inv_number order by inv_number desc, inv_date asc ; 

I am getting this error:

ORA-00923: FROM keyword not found where expected

Any recommendations on what I am doing wrong?

 

CUSTOMER
aus CODE
CUS LNAME
CUS FNAME
CUS INITIAL
CUS AREACODE
CUS PHONE
CUS BALANCE
PRODUCT
PODE.
DESCRI PT
INDATE
PCOH
P MIN
P PRICE
P DISOOUNT
V_CODE
VENDOR
V CODE
V NAME
V CONTACT
V_AREACODE
V PHONE
V STATE
V ORDER
INVOICE
INV NUMBER
CUS CODE
INV DATE
UNE
INV NIMBER
TINE NUMBER
P OODE
INE UNITS
LINE PRICE
EMPLOYEE
00
EMP NUM
BMP TITLE
EMP LNAME
BMP ANAME
BMP_INITIAL
EMP DOB
BMP HI RE DATE
BMP AREACODE
EMP PHONE
1 BMP_MGR
G瓦图
164%
Transcribed Image Text:CUSTOMER aus CODE CUS LNAME CUS FNAME CUS INITIAL CUS AREACODE CUS PHONE CUS BALANCE PRODUCT PODE. DESCRI PT INDATE PCOH P MIN P PRICE P DISOOUNT V_CODE VENDOR V CODE V NAME V CONTACT V_AREACODE V PHONE V STATE V ORDER INVOICE INV NUMBER CUS CODE INV DATE UNE INV NIMBER TINE NUMBER P OODE INE UNITS LINE PRICE EMPLOYEE 00 EMP NUM BMP TITLE EMP LNAME BMP ANAME BMP_INITIAL EMP DOB BMP HI RE DATE BMP AREACODE EMP PHONE 1 BMP_MGR G瓦图 164%
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Query Syntax
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education