Using MySQL to analyze given database.

Programming

Please submit your SQL queries and a pdf using the Jupyter Notebook for each sub-question listed below.

1 Part I

Submit the queries for table creation and data import.

? Load the two files: stock.txt and compustat.csv.

? In stock.txt, the columns are identifi er (integer), date (use numeric), ticker, company name, price, volume,

outstanding shares.

? In compustat.csv, the columns are identifi er (integer), date (use numeric), year, quarter, month, ticker, cusip code (character), company name, total assets, outstanding shares, total liabilities, cik code (integer), price.

Use compustat table to answer the following questions, and submit all queries you used:

1. The number of records inside the table.

2. The number of tickers inside the table.

3. The earliest and latest date of all records.

4. Do all firms have a price? If no, what is the number of records with price data missing.

Use compustat table to answer the following questions, and submit all queries you used:

1. Calculate the ratio of total liabilities/total assets for all fi rms, named as debt to asset ratio”, and the multiplication of price and outstanding shares, named as market capital”. In the output, you need to display 5 columns: date, ticker, debt to asset

ratio”, market capital” and the difference between total assets and market capital.

2. Export the previous output into a csv file.

2 Part II

Use COMPUSTAT dataset to answer the following questions:

? Get the 3 stock tickers (tic) who has the largest average total assets (atq) in fyearq 2016. (Hint: you can use order and limit to perform this result).

? List all company name and the value of outstanding

shares (cshoq) when the largest outstanding shares

between 2015 to 2017 is larger than 500.

Use COMPUSTAT dataset to perform the following operations:

? Add a column ceq (common equity) with double type.

? Set the value in ceq to the multiplication of cshoq and prccq.

? Get the number of NULL value in ceq column.

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational