SQL query project

5 pts.
Tags:
Oracle 10g
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 to know how the query would be made.


Software/Hardware used:
oracle 10g xpress edition

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following