Skip to content

Comments

feat(analytics): add Santander bank analytics database and queries#3

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1764585060-santander-analytics
Open

feat(analytics): add Santander bank analytics database and queries#3
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1764585060-santander-analytics

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Dec 1, 2025

feat(analytics): add Santander bank analytics database and queries

Summary

This PR adds a SQLite database with customer and transaction data, along with analytical SQL queries and a data loading script. The database contains 500 customers and 5,000 transactions loaded from Excel source files.

Files added:

  • data/santander_bank.db - Pre-populated SQLite database
  • scripts/load_data.py - Python script to recreate the database from Excel files
  • scripts/query_1_customer_demographics.sql - Customer count, avg age, avg balance by segment
  • scripts/query_2_monthly_transactions.sql - Monthly transaction volume by category
  • scripts/query_3_top_customers.sql - Top 10 customers by transaction count
  • scripts/query_4_channel_analysis.sql - Average transaction amount by channel

Review & Testing Checklist for Human

  • Verify Excel source files exist: The load_data.py script expects santander_customers.xlsx and santander_transactions.xlsx in the data/ directory. These are not committed - confirm if they should be added or documented.
  • Test SQL queries against the database: Run each query file against santander_bank.db to verify they return expected results
  • Verify database schema: Check that data types (TEXT for dates, INTEGER for booleans) are appropriate for your use case

Recommended test plan:

# Test the queries work
python -c "import sqlite3; conn = sqlite3.connect('data/santander_bank.db'); print(conn.execute('SELECT COUNT(*) FROM customers').fetchone())"
# Expected: (500,)

Notes

  • The SQLite database is committed as a binary file (~247KB). Consider if this should be gitignored and regenerated via the load script instead.
  • SQL queries use SQLite-specific strftime() function - not portable to other databases.
  • Foreign key constraints are defined but not enforced by default in SQLite.

Link to Devin run: https://app.devin.ai/sessions/f8ee95a0e1cd404a86aadd93b70546eb
Requested by: Joao Esteves (@joao-cognition)

- Add SQLite database (santander_bank.db) with customers and transactions tables
- Add data loading script (scripts/load_data.py) to create and populate database
- Add individual analytical SQL queries:
  - query_1_customer_demographics.sql: Customer count, avg age, avg balance by segment
  - query_2_monthly_transactions.sql: Monthly transaction volume by category
  - query_3_top_customers.sql: Top 10 customers by transaction count
  - query_4_channel_analysis.sql: Average transaction amount by channel

Database contains:
- 500 customers with demographics, account info, and preferences
- 5,000 transactions with amounts, categories, and channels

Co-Authored-By: Joao Esteves <joao.esteves@cognition.ai>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants