A modernized version of the classic Sakila database with 2025 data, supporting multiple database platforms.
- π¬ Real movie data from TMDB API
- π³ Realistic customer and payment data
- ποΈ Multi-database support: MySQL, PostgreSQL, SQL Server, MongoDB
- π CSV exports for data analysis
- π Fully reproducible with Python scripts
Ready-to-use database dumps are available in the Sakila25/ folder. Simply restore them using your preferred database tool:
# MySQL
mysql -u username -p sakila25 < Sakila25/sakila25_mysql.sql
# PostgreSQL
psql -U username -d sakila25 -f Sakila25/sakila25_postgresql.sql
# SQL Server
sqlcmd -S localhost -d sakila25 -i Sakila25/sakila25_sqlserver.sqlThe schema includes:
- Films with actors, categories, and languages
- Customers with addresses and payment cards
- Providers (streaming services) with inventory
- Subscriptions and Payments
- Views for common queries (actor_info, customer_list, film_list, revenue_by_provider)
- β Modern 2025 movie data
- β Streaming providers instead of rental stores
- β Subscription-based model with payments
- β Credit card information
- β Multi-database support including NoSQL
- β Automated data generation from APIs
- Python 3.12+
- Database Server (one or more):
- MySQL 8.0+
- PostgreSQL 13+
- SQL Server 2019+
- MongoDB 5.0+
- TMDB API Key - Free from themoviedb.org
git clone https://github.com/lilhuss26/sakila25.git
cd sakila25
pip install -r requirements.txtCreate a .env file based on .env.example:
TMDB_API_KEY="your_tmdb_api_key"
TMDB_TOKEN="your_tmdb_token"
MYSQL_STRING="mysql+pymysql://username:password@localhost:3306"
POSTGRESQL_STRING="postgresql+psycopg2://username:password@localhost:5432/sakila25"
SQLSERVER_STRING="mssql+pymssql://username:password@localhost:1433/sakila25"
MONGODB_STRING="mongodb://username:password@localhost:27017/"Important: For PostgreSQL and SQL Server, create the database first:
-- PostgreSQL
CREATE DATABASE sakila25;
-- SQL Server
CREATE DATABASE sakila25;Then run the creation scripts:
# MySQL (auto-creates database)
python scripts/create_mysql.py
# PostgreSQL
python scripts/create_postgresql.py
# SQL Server
python scripts/create_sqlserver.py
# MongoDB (auto-creates database)
python scripts/create_mongodb.py
# Generate CSV files
python scripts/create_csv.pysakila25/
βββ src/
β βββ FetchData/ # API data fetchers
β β βββ Fetchers/ # Individual fetcher modules
β β βββ FetchData.py # Main fetcher orchestrator
β βββ DatabasesCreation/ # Database implementations
β βββ MySQL/ # MySQL schema, insertion, views
β βββ PostgreSQL/ # PostgreSQL schema, insertion, views
β βββ SQLServer/ # SQL Server schema, insertion, views
β βββ MongoDB/ # MongoDB denormalized structure
β βββ CSV/ # CSV export functionality
βββ scripts/ # Database creation scripts
βββ Sakila25/ # Pre-built database backups
βββ .env.example # Environment configuration template
- SQLAlchemy - ORM and schema management
- pymongo - MongoDB driver
- pymssql - SQL Server drivers
- psycopg2 - PostgreSQL driver
- pymysql - MySQL driver
- requests - API data fetching
- pandas - CSV generation
- python-dotenv - Environment configuration
- Movies & Actors: The Movie Database (TMDB) API
- Customers: Random User Generator API
- Credit Cards: Faker API
MongoDB uses a denormalized structure for optimal performance:
- films collection: Embedded actors, categories, and language
- providers collection: Embedded inventory
- customers collection: Embedded address, card, subscriptions, and payments
- Ensure database servers are running
- Verify connection strings in
.env - Check firewall settings
- SQL Server doesn't support
ORDER BYin views withoutTOP - Views are created without ordering; add
ORDER BYwhen querying
- MongoDB doesn't require database creation beforehand
- Database is created automatically on first insert
Contributions are welcome! Please feel free to submit a Pull Request.
