Question: Please use the stocksdb database. You may choose necessary fields to display (in addition to those indicated) and sort the data as you deem appropriate.
Please use the stocksdb database. You may choose necessary fields to display (in addition to those indicated) and sort the data as you deem appropriate. You may find the entity-relationship diagram listing the tables with various fields and relationships among tables useful in thinking through the queries. Each of these queries should take no more than 10 minutes to formulate. Feel free to contact me if you need any assistance. It may be convenient to write the query on paper and then try it on the MySQL database.
Display the industry and the average EPS for all stocks in that industry; Include only those industries with the average EPS exceeding 20 cents. Sort the results in the order of descending average EPS.
List the stock symbol and the number of times that stock has been traded. Include only those stocks that have been traded fewer than 6 times. Sort the results in the order of stock symbols.
List the stock symbol, name and its yearly average historic price (that is, list the symbol, name, year and the average price of the 12 monthly prices available in the historical prices table); Include only those stocks and years in which the average price exceeded $50.
List the account and the total worth (value) of each account, using all stock ownerships except those that belong to the "Petroleum" industry. Include only those accounts whose total calculated value lies between 50,000 and 250,000.
List the total worth (value) of each account of customer Virginia Russell. Include only those accounts whose total calculated value falls below 200,000.
Create two queries of your own that answers interesting business questions that may help in decision making. These queries should use more than one table, use aggregation operators and have one or more conditions on the group and must be different from the ones we have seen in class or assignments.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
