Files
SQL/docker/init/00-init-database.sql
Alphaeus Mote b30733ccad Add complete financial fraud detection database with Docker, schema, data generation, and SQL exercises
- 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
2025-10-23 13:53:30 -04:00

23 lines
858 B
SQL

-- ============================================================================
-- Database Initialization Script
-- ============================================================================
-- This script ensures the database is created and ready
-- It runs automatically when the PostgreSQL container starts
-- ============================================================================
-- Ensure the database exists (this runs in the default postgres database)
SELECT 'Database initialization starting...' AS status;
-- Set timezone
SET timezone = 'UTC';
-- Show current database
SELECT current_database() AS current_db, current_user AS current_user, version() AS pg_version;
-- Enable required extensions
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
SELECT 'Extensions enabled successfully' AS status;