Repository navigation
Expand file tree
/
Copy pathSQLDashboard2.sql
More file actions
62 lines (62 loc) · 1.75 KB
/
Copy pathSQLDashboard2.sql
File metadata and controls
62 lines (62 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
--analysing total loan applications,total funded amount,total amount received
use [Loan DB]
select * from loan_data
select
month(issue_date) as month_number,
DATENAME(month, issue_date) as month_name,
count(id) as total_loan_applications,
sum(loan_amount) as total_funded_amount,
sum(total_payment) as total_amount_received
from loan_data
group by datename(month, issue_date),month(issue_date)
order by month(issue_date)
select
address_state as state,
count(id) as total_loan_applications,
sum(loan_amount) as total_funded_amount,
sum(total_payment) as total_amount_received
from loan_data
group by address_state
order by address_state
select
term,
count(id) as total_loan_applications,
sum(loan_amount) as total_funded_amount,
sum(total_payment) as total_amount_received
from loan_data
group by term
order by term
select
emp_length,
count(id) as total_loan_applications,
sum(loan_amount) as total_funded_amount,
sum(total_payment) as total_amount_received
from loan_data
group by emp_length
order by emp_length
select
purpose,
count(id) as total_loan_applications,
sum(loan_amount) as total_funded_amount,
sum(total_payment) as total_amount_received
from loan_data
group by purpose
order by count(id) desc
select
home_ownership,
count(id) as total_loan_applications,
sum(loan_amount) as total_funded_amount,
sum(total_payment) as total_amount_received
from loan_data
group by home_ownership
order by count(id)
---applying filters and observing the trends
select
home_ownership,
count(id) as total_loan_applications,
sum(loan_amount) as total_funded_amount,
sum(total_payment) as total_amount_received
from loan_data
where grade='A' and address_state='IL'
group by home_ownership
order by count(id)