In this lab, you will run basic SQL queries on a simulated banking system. You’ll use only the following SQL clauses:
SELECTFROMWHEREORDER BYDISTINCTLIMIT
Assume that any ID columns are incremental, meaning that higher IDs always occurred after lower ones. For example, a customer with a higher CustomerID joined the bank after one with a lower CustomerID.
Expected Output:
Closed
Defaulted
Active
Expected Output:
92855.81
68831.70
39598.73
64812.74
89911.22
Expected Output:
Debit
Credit
4. From the Customers table, what are the names of the first 5 customers who completed KYC verification?
Expected Output:
Daniel Garcia
Jessica Tran
David Thompson
Timothy Bennett
Matthew Howard
5. From the Customers table, what is the CustomerID of the latest customer from the Wisconsin region?
Expected Output:
61
Expected Output:
4822.01
12783.93
13513.40
Expected Output:
37
Expected Output:
11
Expected Output:
47
63
74
Expected Output:
14
33
38
43
75
86
102
107
120
133
187
192
207
🌶️ 11. From the Transactions table, show the TransactionID, Date, and Amount of the 10 most recent transactions from AccountID = 5.
Expected Output:
54 2024-10-17 2215.78
48 2024-08-20 2047.66
53 2024-08-04 280.48
51 2024-07-20 1579.44
56 2024-06-16 2428.71
47 2024-06-11 4073.08
50 2023-08-14 4726.52
55 2023-02-21 2750.61
52 2022-08-26 4325.90
49 2022-08-03 1655.72
🌶️🌶️ 12. From the Cards table, what are the last 3 CustomerIDs that have the latest expired credit cards?
Expected Output:
98
94
80