Dataset: Problem:: Expected Result: .SQL
Dataset: Problem:: Expected Result: .SQL
Table: Transaction
Table: Customer
Biz Glossary/Data Definition
loan_status (string): whether loan already paid or not
contain ‘PAIDOFF’ or ‘ACTIVE’.
amount (integer): total amount of that transaction
tenure (integer): how long the installment is 7, 15, 30,
60, etc. in days.
eff_date (date): date when the transaction happen and
the installment start counting
due_date (date): when the transaction need to be paid
paid_off_time (timestamp): when the customer actually
paid the transaction
age (integer): customer’s age
education (string): customer’s last education level
gender (string): customer’s gender
days_past_due (integer): how many days after
due_date customer havent make payments.
Problem:
Construct query script to solve below problem using previous
page dataset, preferably in sql code compatible with MySQL
standards:
1. Show total amount of transaction made by/grouped by
customer’s age and gender.
2. We have a typo in education, find it and fix it within your
query. Also there are still many variance of Master
degrees that need to be combined into 1 (called ‘Master
Degree’). Then after all that show total unique customer
by their education level that has transaction with us.
Problem:
Construct query script to solve below problem using previous
page dataset, preferably in sql code compatible with MySQL
standards:
3. For each customer and their tenure selection, we need
their first transaction eff_date, due_date, and
paid_off_time if they already paid. Then afterwards for
each first transaction of that hasn’t paid we need to
calculate their days_past_due compared to today. Terms
and tenure is same.
Problem:
Construct query script to solve below problem using previous
page dataset, preferably in sql code compatible with MySQL
standards:
4. Need a summarized customer table consist of below
format. For every customer their summary of total
amount, when is their first and last transaction, due date,
and not forget their favorite tenure product (either 7, 15,
30, etc.). Terms and tenure is same.
Problem:
Construct query script to solve below problem using previous
page dataset, preferably in sql code compatible with MySQL
standards:
5. We need a summary table of age profiling as below with
age bucket and their top and bottom amount in
transposed format. And within their age group top-3
(biggest amount) and bottom-3 (smallest amount) along
with their customer_id all in a transposed format as
below.