Home » SQL & PL/SQL » SQL & PL/SQL » Scripting Calculation / Table Creation Problem
Scripting Calculation / Table Creation Problem [message #6680] Thu, 01 May 2003 15:11 Go to next message
Rudy
Messages: 12
Registered: March 2002
Junior Member
I have created the following database, but am having problems in calculating the PROFIT. I was told not to to add the column in the table for PROFIT.

The question: PRINT ITEMNAME, COST PRICE, QUANITITY, PROFIT (PROFIT =(PRICE * QUANTITY) - (COST * QUANTITY))

I believe this is the first part of the script: SELECT ITEMNAME, COST, QUANTITY, PROFIT
But where do you put the calculation:
Last part should be the name of the table: FROM TOY2;

Appreciate any help.

Rudy
Re: Scripting Calculation / Table Creation Problem [message #6683 is a reply to message #6680] Thu, 01 May 2003 15:55 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
I would simplify the profit formula a bit:

select itemname, cost, price, quantity, (price - cost) * quantity as profit
  from toy2;
Re: Scripting Calculation / Table Creation Problem [message #6706 is a reply to message #6683] Fri, 02 May 2003 05:54 Go to previous message
Rudy
Messages: 12
Registered: March 2002
Junior Member
Thank you ORAFAQ Message Board and people like Todd Barry. Newbies like myself are trying to re-train our career objectives hopefully new career path.

Thank you both again.
Previous Topic: Oracle 8i Personal Edition
Next Topic: Oracle 9i Help!
Goto Forum:
  


Current Time: Fri Apr 26 22:18:20 CDT 2024