SQL Command Query Programming In The Jupyter Notebook 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 identifier (integer), date (use numeric), ticker, company name, price, volume,
outstanding shares.
In compustat.csv, the columns are identifier (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 firms, 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. 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 identifier (integer), date
(use numeric), ticker, company name, price, volume,
outstanding shares.
In compustat.csv, the columns are identifier (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.
1
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 firms, 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.
2
Set the value in ceq to the difference between total
asset (atq) to total liabilities (ltq) if ceq is NULL
after executing the previous query.
Get the number of NULL value in ceq column.
Remove the column fyr.
3
Purchase answer to see full
attachment
Why Choose Us
Top quality papers
We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.
Professional academic writers
We have hired a team of professional writers experienced in academic and business writing. Most of them are native speakers and PhD holders able to take care of any assignment you need help with.
Free revisions
If you feel that we missed something, send the order for a free revision. You will have 10 days to send the order for revision after you receive the final paper. You can either do it on your own after signing in to your personal account or by contacting our support.
On-time delivery
All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.
Original & confidential
We use several checkers to make sure that all papers you receive are plagiarism-free. Our editors carefully go through all in-text citations. We also promise full confidentiality in all our services.
24/7 Customer Support
Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.
Essays
You are welcome to choose your academic level and the type of your paper. Our academic experts will gladly help you with essays, case studies, research papers and other assignments.
Admissions
Admission help & business writing
You can be positive that we will be here 24/7 to help you get accepted to the Master’s program at the TOP-universities or help you get a well-paid position.
Reviews
Editing your paper
Our academic writers and editors will help you submit a well-structured and organized paper just on time. We will ensure that your final paper is of the highest quality and absolutely free of mistakes.
Reviews
Revising your paper
Our academic writers and editors will help you with unlimited number of revisions in case you need any customization of your academic papers