You are a data engineer at a gaming platform that needs to analyze betting data and create dashboards. This is a simple challenge to test your SQL skills and dashboard creation abilities.
Estimated Time: 2 hours
Write SQL queries to answer these questions using the provided data:
- Total betting volume by sport
- Win rate by bet type (moneyline, spread, over/under)
- Top 5 users by total betting volume
- Daily betting volume trend
- Average stake by user risk level
Create a simple dashboard with these visualizations:
- Bar chart: Betting volume by sport
- Pie chart: Win rate by bet type
- Line chart: Daily betting volume
- Table: Top users by volume
- Summary metrics: Total volume, total bets, average stake
Write a brief analysis answering:
- Which sport has the highest betting volume?
- Which bet type has the best win rate?
- What insights can you draw about user behavior?
- What recommendations would you make to improve the platform?
# Install required packages
pip install -r requirements.txt# This creates a SQLite database with your data
python setup_data.pyWhat setup_data.py does:
- Loads CSV files from
data/raw/folder - Creates a SQLite database called
betting_data.db - Shows you sample data to understand the structure
After running setup_data.py, you'll see:
- Sample betting data
- Sample user data
- Sample game data
- Database file created:
betting_data.db
- Write SQL queries in
queries.sql - Create dashboard using
dashboard_template.py - Write analysis in
analysis_template.md
# To see your dashboard in action
python run_dashboard.pybetting_data.csv- Bet transactionsuser_data.csv- User informationgame_data.csv- Game results
After running setup_data.py, you'll have these tables:
- bets - All betting transactions
- users - User profiles and preferences
- games - Game results and scores
- SQL Skills: Correct and efficient queries
- Dashboard Quality: Clear, informative visualizations
- Analysis: Insightful observations and recommendations
- Code Quality: Clean, well-documented code
queries.sql- Your SQL queriesdashboard.py- Your dashboard codeanalysis.md- Your written analysis- Screenshots of your dashboard
Good luck! 🏈⚽🏀