sql query
5 pts.
0
Q:
sql query
i am working on a project. If i enter the a/c no and i found correct then the companies name and their share values are provided to me.. After that when i buy a no of shares i get the Transaction amount(no of shares*share value),broker value(1.5% of transaction amount),total amount (transaction amount+broker value)..
All the tables are created and i really need how the query would be madeĀ 


Software/Hardware used:
oracle 10g xpress edition
ASKED: Oct 28 2009  5:43 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
495 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
To give you a specific query for the results would require table and column names and specifics concerning their definitions. From the content of your question, it appears that you know the calculations necessary, you just need to plug in the column names for the variables you have listed. You'll need to know the table and column to get share value for a given company, then with the input of number of shares, you can calculate transaction amount, broker value and total amount.

Presuming you have columns "sharevalue" and "sharename" in a table "stockinvestments", You could issue the command: (also presuming the input of numshares and stockname as the input values)

select &&numshares * sharevalue as transamount,
.015*(&&numshares * sharevalue) as brokeramount,
1.015*(&&numshares* sharevalue) as totalamount
from stockinvestments
where sharename="&&stockname";

Pretty straight forward. I know there are various other methods to get the values, but this is simple and direct.
Last Answered: Oct 28 2009  3:55 PM GMT by Jcmdba   495 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



0