A Dockerized Microsoft SQL Server database for a classic movie rental domain—customers, movies, inventory, rentals, and payments—with seed data, views, procs, and triggers.
erDiagram
CUSTOMERS ||--o{ RENTALS : makes
STAFF ||--o{ RENTALS : handles
STORES ||--o{ STAFF : employs
STORES ||--o{ INVENTORY : stocks
MOVIES ||--o{ INVENTORY : listed_as
MOVIES ||--o{ MOVIEGENRES : labeled
GENRES ||--o{ MOVIEGENRES : categorizes
INVENTORY ||--o{ RENTALS : fulfills
RENTALS ||--o{ PAYMENTS : billed
CUSTOMERS { int CustomerID PK string FirstName string LastName string Email string Phone string Status }
MOVIES { int MovieID PK string Title int ReleaseYear string Rating decimal RentalRate decimal ReplacementCost }
GENRES { int GenreID PK string Name }
MOVIEGENRES { int MovieID FK int GenreID FK }
STORES { int StoreID PK string Name string AddressLine1 string City string State }
STAFF { int StaffID PK int StoreID FK string FirstName string LastName string Email bool Active }
INVENTORY { int InventoryID PK int MovieID FK int StoreID FK int CopiesTotal int CopiesAvailable }
RENTALS { int RentalID PK int InventoryID FK int CustomerID FK int StaffID FK datetime RentedAt datetime DueAt datetime ReturnedAt string Status }
PAYMENTS { int PaymentID PK int RentalID FK decimal Amount datetime PaidAt string Method }
- Create .env with
SA_PASSWORD docker compose -f docker/docker-compose.yml up -d- Apply scripts:
sqlcmd -i scripts/apply.sqlvia container (see scripts section) - Try
RentMovie/ReturnMovieto validate logic.
docker/compose & runtimesql/DDL, views, procs, triggers, seedscripts/orchestration.sqldata/CSVs (future)
Use scripts/apply.sql to apply in correct order.
Two CSVs are generated by the Nightly DB reports workflow and attached as run artifacts:
overdue_rentals.csv(fromdbo.vwOverdueRentals)low_inventory.csv(fromdbo.vwLowInventory)
gh workflow run "Nightly DB reports"
RUN_ID=$(gh run list --workflow "Nightly DB reports" --limit 1 --json databaseId -q '.[0].databaseId')
gh run watch "$RUN_ID" --interval 5gh run download "$RUN_ID" -n reports -D .
ls -la reportsMIT — see LICENSE.