-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQ1 SQL output
74 lines (63 loc) · 3.64 KB
/
Q1 SQL output
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
63
64
65
66
67
68
69
70
71
72
73
74
Query 1
|customerid|transtype|amount |transdate |weekday |
|----------|---------|---------|----------|---------|
|1 |Credit |?2,000.00|01/01/2005|Saturday |
|1 |Credit |?2,200.00|02/01/2005|Tuesday |
|1 |Debit |?2,000.00|03/02/2005|Wednesday|
|2 |Credit |?2,000.00|01/01/2005|Saturday |
|2 |Debit |?234.22 |02/01/2005|Tuesday |
|2 |Credit |?2,000.00|04/01/2005|Friday |
|3 |Debit |?200.20 |02/20/2005|Sunday |
|3 |Debit | |02/21/2005|Monday |
|3 |Credit |?334.55 |03/31/2005|Thursday |
|4 |Credit |?332.45 |04/30/2005|Saturday |
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Query 2:
|customerid|transdate |Credit Amount|Debit Amount|
|----------|----------|-------------|------------|
|1 |01/01/2005|?2,000.00 |?0.00 |
|1 |02/01/2005|?2,200.00 |?0.00 |
|1 |03/02/2005|?0.00 |?2,000.00 |
|2 |01/01/2005|?2,000.00 |?0.00 |
|2 |02/01/2005|?0.00 |?234.22 |
|2 |04/01/2005|?2,000.00 |?0.00 |
|3 |02/20/2005|?0.00 |?200.20 |
|3 |02/21/2005|?0.00 | |
|3 |03/31/2005|?334.55 |?0.00 |
|4 |04/30/2005|?332.45 |?0.00 |
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Query 3:
|customerid|transdate |Credit Amount|Debit Amount|
|----------|----------|-------------|------------|
|2 |04/01/2005|?2,000.00 |?0.00 |
|4 |04/30/2005|?332.45 |?0.00 |
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Query 4:
|customerid|transdate |Credit Amount|Debit Amount|
|----------|----------|-------------|------------|
|1 |01/01/2005|?2,000.00 |?0.00 |
|1 |02/01/2005|?2,200.00 |?0.00 |
|2 |01/01/2005|?2,000.00 |?0.00 |
|2 |02/01/2005|?0.00 |?234.22 |
|2 |04/01/2005|?2,000.00 |?0.00 |
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Query 5:
|customerid|transdate |Credit Amount|Debit Amount|
|----------|----------|-------------|------------|
|3 |03/31/2005|?334.55 |?0.00 |
|4 |04/30/2005|?332.45 |?0.00 |
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Query 6:
|customerid|year|credit_total_amount|debit_total_amount|
|----------|----|-------------------|------------------|
|1 |2005|?4,200.00 |?2,000.00 |
|2 |2005|?4,000.00 |?234.22 |
|3 |2005|?334.55 |?200.20 |
|4 |2005|?332.45 |?0.00 |
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------