Question
1. Import given bank data into PostgreSQL database. 2. a primary key for the import table. 3. Find the highest asset observation for each bank.(i.e.
1. Import given bank data into PostgreSQL database.
2. a primary key for the import table.
3. Find the highest asset observation for each bank.(i.e. There are 4 observations for each bank
in a year. If there're 100 unique banks in total, then the result contains 100 observations.
Each observation may belong to dierent quarters.) Sort the resulting table according to asset
value. Report the rst 10 observations of output table.
4. Show the query plan for question 1.3 using EXPLAIN tool.
5. Given the highest asset table from question 1.3, count how many observations are there for
each quarter.
6. For the whole sample data, how many observations have asset value higher than 100,000 and
liability value smaller than 100,000.
7. Each observation was given an 'idx' number. Find the average liability of observation with
odd 'idx' number.
8. Find the average liability of observation with even 'idx' number. What's the dierence between
these two average number.
9. For each bank and all records with increased asset. The record with increase asset means one
record's asset value is larger than the one of previous quarter. (For instance a bank (id: 123)
has asset 30,000 in 3/31/02, asset 20,000 in 6/30/02 and asset 25,000 in 9/30/02. Then the
record with bank id (123), asset value (25,000) and date (9/30/02) is recorded. Because its
asset value is larger than the asset value in 6/30/02.) Report the first 10 observation of output
table.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started