Given a stock table with column names: data,open,high,low,close,volunme and adjc
ID: 3698724 • Letter: G
Question
Given a stock table with column names: data,open,high,low,close,volunme and adjclose, write a SQL query that does the following:
Compute the daily value of the investment, ignoring dividends Look at the stock table and the "close" column for each date. Find the price of the security on January 16, 2015. Find the number of shares you can buy for the $10,000 starting investment at that day's closing price. Multiply the quantity by the closing price for every day between January 16, 2015 until June 17, 2016 to obtain the value of the investment every day.
Note: use closing price when determining the number of shares.
Explanation / Answer
These question contain 3 queries. Solutions are:
Select SUM(open) AS Price-of-Security from Stock where date='2015-01-16';
Select count(close) AS no-of-Shares from Stock where low>=10000
Select volunme*close as val- of-invest from Stock where date in('2015-01-16','2017-06-17')
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.