{"id":23422673,"url":"https://github.com/lerocha/netflixdb","last_synced_at":"2026-06-17T02:01:16.518Z","repository":{"id":269039776,"uuid":"879527210","full_name":"lerocha/netflixdb","owner":"lerocha","description":"Sample database for MySQL, Oracle, PostgreSQL, SQLite, and SQL Server. Based on data from the Netflix Engagement Report and the Netflix Global Top 10 weekly list, it includes movies and TV shows for learning and practice purposes.","archived":false,"fork":false,"pushed_at":"2026-06-10T00:40:18.000Z","size":25913,"stargazers_count":107,"open_issues_count":1,"forks_count":15,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-06-10T02:13:59.639Z","etag":null,"topics":["database","mysql","oracle","postgres","postgresql","sql","sqlserver"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lerocha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-28T04:29:17.000Z","updated_at":"2026-06-10T00:34:36.000Z","dependencies_parsed_at":"2025-11-28T13:02:23.387Z","dependency_job_id":null,"html_url":"https://github.com/lerocha/netflixdb","commit_stats":null,"previous_names":["lerocha/netflixdb"],"tags_count":55,"template":false,"template_full_name":null,"purl":"pkg:github/lerocha/netflixdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerocha%2Fnetflixdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerocha%2Fnetflixdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerocha%2Fnetflixdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerocha%2Fnetflixdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lerocha","download_url":"https://codeload.github.com/lerocha/netflixdb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lerocha%2Fnetflixdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34430688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","mysql","oracle","postgres","postgresql","sql","sqlserver"],"created_at":"2024-12-23T03:09:26.953Z","updated_at":"2026-06-17T02:01:16.484Z","avatar_url":"https://github.com/lerocha.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Netflix Sample Database\n\nSample database based on the data from the [Netflix Engagement Report](https://about.netflix.com/en/news/what-we-watched-the-first-half-of-2024) and the [Netflix Global Top 10](https://www.netflix.com/tudum/top10) weekly list, it includes movies and TV shows for learning and practice purposes.\n\n## Supported Database Servers\n\n* MySQL\n* Oracle\n* PostgreSQL\n* SQLite\n* SQL Server\n\n## Download\nDownload the SQL scripts from the [latest release](../../releases) assets. One or more SQL script files are provided for each database vendor supported. You can run these SQL scripts with your preferred database tool.\n\n## Data Sources\n\n* https://about.netflix.com/en/news/what-we-watched-the-first-half-of-2024\n* https://about.netflix.com/en/news/what-we-watched-the-second-half-of-2023\n* https://www.netflix.com/tudum/top10\n\n## Data Model\n\n![database.png](src/main/resources/images/database.png)\n\n## Sample Queries - Postgres\n\n```sql\n-- Movies released since 2024-01-01\nselect id, title, runtime from movie where release_date \u003e= '2024-01-01';\n```\n\n```sql\n-- TV Show Seasons released since 2024-01-01\nselect s.id, s.title as season_title, s.season_number, t.title as tv_show, s.runtime\nfrom season s left join tv_show t on t.id = s.tv_show_id\nwhere s.release_date \u003e= '2024-01-01';\n```\n\n```sql\n-- Top 10 movies (English)\nselect v.view_rank, m.title, v.hours_viewed, m.runtime, v.views, v.cumulative_weeks_in_top10\nfrom view_summary v\ninner join movie m on m.id = v.movie_id\nwhere duration = 'WEEKLY'\n  and end_date = '2025-06-29'\n  and m.locale = 'en'\norder by v.view_rank;\n```\n\n```sql\n-- Engagement report\nselect m.title, m.original_title, m.available_globally, m.release_date, v.hours_viewed, m.runtime, v.views\nfrom view_summary v\ninner join movie m on m.id = v.movie_id\nwhere duration = 'SEMI_ANNUALLY'\n  and start_date = '2024-01-01'\norder by v.view_rank asc;\n```\n\n## Development\n\n* The application is a [Spring Boot](https://spring.io/projects/spring-boot) application that uses [Spring Data JPA](https://spring.io/projects/spring-data-jpa) / [Hibernate](https://hibernate.org/orm/) Object/Relational Mapping framework. \n* The database schema is defined in these [entity classes](src/main/kotlin/com/github/lerocha/netflixdb/entity), and it gets auto-generated when the application starts up.\n* After start-up, the application uses [Spring Batch](https://spring.io/projects/spring-batch) to run a [batch job](src/main/kotlin/com/github/lerocha/netflixdb/batch/ImportNetflixDataJobConfig.kt) to populate the database based on the [Netflix spreadsheet reports](src/main/resources/reports), and then exports the database schema and data to a SQL script.\n\n### System Requirements\n* JDK 21, for example: [Amazon Corretto 21](https://docs.aws.amazon.com/corretto/latest/corretto-21-ug/downloads-list.html), [Oracle OpenJDK 21](https://www.oracle.com/java/technologies/downloads/#java21), [MS OpenJDK 21](https://learn.microsoft.com/en-us/java/openjdk/download#openjdk-2105-lts--see-previous-releases), etc.\n* [Docker Desktop](https://www.docker.com/products/docker-desktop/)\n\n### Building and generating the SQL Scripts\n\nStart the database containers:\n```bash\ndocker compose up -d\n```\n\nGenerate the SQL Scripts:\n```bash\n./build.sh\n```\n\nThe generated SQL scripts will be in the `build/artifacts` folder:\n```bash\nopen ./build/artifacts\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flerocha%2Fnetflixdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flerocha%2Fnetflixdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flerocha%2Fnetflixdb/lists"}