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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!