MERCHANT CATEGORIES FIX:
- Fixed duplicate category_code '7995' (Gambling vs Online Gambling)
- Changed Online Gambling code from '7995' to '7996'
- Fixed duplicate 'Direct Marketing' names to be unique
- Changed to 'Direct Marketing Inbound' and 'Direct Marketing Outbound'
- This was causing UNIQUE constraint violation preventing merchant_categories from loading
FRAUD TYPES QUERY FIX:
- Fixed column names in verification query
- Changed from fraud_type_code to fraud_code
- Changed from fraud_type_name to fraud_name
- Matches actual table schema in 01-create-tables.sql
IMPACT:
- Merchant categories will now load correctly (33 categories)
- Fraud types verification query will work without errors
- Setup script will complete all 5 verification queries successfully
PGADMIN FIX:
- Changed email from admin@businessanalytics.local to admin@example.com
- pgAdmin rejects .local domains as invalid email addresses
- Updated all documentation with correct email
SETUP VERIFICATION:
- Added 5 SQL verification queries to setup-database.sh
- Query 1: Sample countries (top 5)
- Query 2: Sample merchant categories (top 5)
- Query 3: All transaction types with descriptions
- Query 4: All fraud types ordered by severity
- Query 5: All customer segments with descriptions
BENEFITS:
- Users can immediately see that data was loaded correctly
- Provides visual confirmation of schema setup
- Shows sample data structure before generating full dataset
- Helps troubleshoot setup issues early
DEPENDENCY MANAGEMENT:
- Created scripts/install-dependencies.sh - automatic installer for all required packages
- Detects OS (Ubuntu, Debian, CentOS, RHEL, Fedora, Arch, macOS)
- Installs PostgreSQL client (psql) automatically
- Installs Docker & Docker Compose if missing
- Installs utility packages (curl, wget, git)
SCRIPT ENHANCEMENTS:
- Updated setup-database.sh with dependency checking
- Updated generate_data.sh with dependency checking
- Updated verify-setup.sh with dependency checking
- All scripts now prompt to run installer if dependencies are missing
- Interactive prompts guide users through installation
DOCUMENTATION:
- Updated README.md with dependency installation instructions
- Updated QUICKSTART.md with Step 0: Install Dependencies
- Added supported OS list
- Added automatic dependency check notes
USER EXPERIENCE:
- No more manual package installation required
- Scripts fail gracefully with helpful error messages
- One-command installation: ./scripts/install-dependencies.sh
- Automatic detection and installation on Linux/macOS
- Clear instructions for Windows users
This ensures users can get started immediately without hunting for package installation commands.
- Docker setup with PostgreSQL 16 and DB-UI web interface
- Comprehensive 20+ table schema with fraud detection patterns
- Idempotent shell scripts for data generation (no Python dependency)
- Realistic geographic data (100 US cities, 210 world cities)
- 5M+ transactions with embedded fraud patterns (velocity, geographic, structuring, etc.)
- Progressive SQL exercises from beginner to advanced fraud detection
- Complete documentation and quick start guide
- Setup and verification scripts