Hi everyone! Cornellius Yudha Wijaya and Josep Ferrer from DataBites here👋🏻
As promised, today we are publishing the next two issues of our SQL Crash Course – From Zero to Hero! 🚀
I am sure you are here to continue our SQL Crash Course Journey!📚
If this is your first time or you’ve forgotten what we’ll cover, we have previously covered seven key SQL topics, each divided into multiple posts across Non-Brand Data and DataBites.
This week, we will continue to apply our SQL skills to real-world problems.
Last week, Josep and I sent you a simple problem that will test your knowledge using everything we have learned in our previous SQL Crash Courses.
If you miss them, here is the SQL problem you might miss with answers (try to solve it yourself first):
👉SQL COURSE PROBLEM #1 (Answer)
👉SQL COURSE PROBLEM #2 (Answer)
❓ Context
You manage customer relationships at a growing financial institution offering accounts, loans, and credit products. Customers hold multiple account types, conduct transactions, and use various credit services.
As a data analyst, you'll use SQL to:
Analyze account balances and transaction patterns
Identify high-risk loans and credit relationships
Evaluate customer financial health
Generate reports for management
🧱 Database Schema
Sample data contains real financial records:
6 customers with credit scores
8 accounts (checking/savings/credit)
10 transactions (deposits/withdrawals/payments)
5 loans (mortgage/auto/personal/business)
5 credit cards with limits and fees
You can check the schema in the following SQL playground.
🧩 Tasks
Use SQL to answer the following questions:
1. High-Balance Accounts
Show account ID, customer ID, and balance for active accounts with balances above the average balance across all accounts.
Hint: Use a subquery to calculate the overall average account balance.
Keywords: SELECT, WHERE, subquery
2. Large January Transactions
Display the 3 largest withdrawal transactions (amount, merchant, date) from January 2023.
Hint: Filter by transaction type and date range, then sort results.
Keywords: WHERE, ORDER BY, LIMIT
3. Customer Credit Health
Show customer names, credit scores, and credit categories (Excellent ≥800, Good 700-799, Fair <700).
Hint: Use CASE expression to create credit categories.
Keywords: CASE, conditional logic
4. Delinquent Loan Holders
List the first name, last name, and email of customers with delinquent loans.
Hint: Join the customers and loans tables using
customer_id
.Keywords: INNER JOIN, WHERE
5. Unlinked Credit Cards
Display the card ID, customer ID, and credit limit for credit cards not associated with any account.
Hint: Find records where account_id is missing.
Keywords: NULL handling, WHERE
6. Transaction Volume Analysis
Count transactions per account type (checking/savings/credit).
Hint: Join accounts and transactions tables before grouping.
Keywords: JOIN, GROUP BY, COUNT
7. Expiring Credit Cards
List customer names, card IDs, and expiration dates for cards expiring before 2026.
Hint: Filter using date comparison in WHERE clause.
Keywords: Date functions, WHERE
8. High-Risk Credit Profiles
Find customers with credit scores below 700 AND negative account balances.
Hint: Use EXISTS to check for correlated negative balances.
Keywords: Correlated subquery, EXISTS
9. Combined Financial Products
Create a unified list that shows the product type ('Loan' or 'Credit Card'), product ID, and customer ID.
Hint: Combine two SELECT statements with UNION ALL.
Keywords: UNION ALL, column alias
10. Payment Patterns
Display the percentage of each transaction type in the total payment volume.
Hint: Use a window function to calculate the percentage of the grand total.
Keywords: Window functions, SUM() OVER()
‼️ Next week, you’ll get the answers to all the tasks!
📥 How to submit?
Open the shared SQL playground from earlier and make a copy to work on your answers.
Once you're done, leave a comment below to confirm your participation and share the link to your playground.
Feel free to share your thoughts or questions as well!
Let’s make this week count 🔥
How to Get Started 🚀
Over the coming weeks, we’ll guide you through:
✅ SQL Fundamentals
✅ Intermediate SQL
✅ Advanced SQL
✅ Database Operations
✅ Writing Efficient Queries
Once you grasp the basics, practice is key! Start working on real-world projects and solving hands-on data problems.
What’s Next? ➡️
This is the first of many posts about the upcoming SQL Courses. It will only explain what SQL is in its crude form.
To get the full experience and fully immersed in the learning:
👉 Subscribe to Databites.tech (By Josep)
👉 Subscribe to Non-Brand Data (By Cornellius)
👉 Check out the SQL Crash Course GitHub repo
👉 Share with your friend and whoever needs it!
🗓️ Every Thursday, you will have two new issues in your inbox!
Let’s dive in and make SQL less scary, more fun, and way more useful! 🚀
Josep & Cornellius