Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write SQL Queries to answer the questions How many accounts were originated/created in September and October 2018? Show the number of new accounts created in

Write SQL Queries to answer the questions

How many accounts were originated/created in September and October 2018? Show the number of new accounts created in these two months in separate rows.

Write queries to show: which day of 09/2018 was the busiest day in terms of total transaction amount/withdrawal amount/deposited amount? Your result should look like the following table: Note Date Amount Total DepositAmount Total TransactionAmount Total Withdrawal Amount total

transaction amount = the sum of the absolute values of transaction amount, total withdrawal amount = the sum of the absolute values of negative amount, total deposit amount = the sum of the absolute values of positive amount.

Which user has the highest number of accounts? Show this users userID, full name, and the number of accounts.

What are the top 3 most frequently used transaction types? Display transaction description, and the number of transactions for each transaction type.

What is the total amount of interest paid by the bank in these two months? (note: interest paid by the bank includes the following transaction type: CD interest payment, IBDA interest paid, interest credit, and IOD interest paid.Total amount of interest paid is the sum of the absolute values of amount in these transaction) T

he data tables are set up as follows :

Transactions table: account_number - Can be up to 16 digits long. Account number that is being used to execute the transaction. The source of transfers and the destination of deposits. (foreign key) amount - amount of the transaction. Any dollar amount and cents. timestamp - YYYY-MM-DD-HH.SS.mm.XXXXXZ (use datetime data type) description - 300 characters long. Information related to transaction. posted_balance - the posted balance after the transaction has been executed. has_image - has an image tied to the transaction (checks, deposit slip, withdrawal slip, etc). Two values: Y/N. Tdate - Transaction date. (primary key)

Accounts table: account_number - Can be up to 16 digits long. Account number that is being used to execute the transaction. The source of transfers and the destination of deposits. (primary key) userid - Unique ID that ties the account to the user. Up to 30 characters long. (foreign key)

Users table: userid - Unique ID that ties the account to the user. Up to 30 characters long. (primary key) firstname - first name. 25 chars long lastname - last name. 25 chars long addr1 - address 1 field. 250 characters addr2 - second address field for apartment or suite numbers. 20 chars long. state - state of the address. 2 chars long. zipcode - zip of the address. At least 4 characters long.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Corporate Finance Theory And Practice

Authors: Aswath Damodaran

2nd Edition

0471283320, 9780471283324

More Books

Students also viewed these Finance questions

Question

13. Let X be exponential with mean 1/; that is, fX (x) = ex , 0 1].

Answered: 1 week ago

Question

How can either be made stronger?

Answered: 1 week ago