{"id":13838249,"url":"https://github.com/airbytehq/SQL-Levels-Explained","last_synced_at":"2025-07-10T21:32:05.185Z","repository":{"id":61616965,"uuid":"525865758","full_name":"airbytehq/SQL-Levels-Explained","owner":"airbytehq","description":"explaining sql levels based on one meme","archived":false,"fork":false,"pushed_at":"2023-08-27T13:09:30.000Z","size":13,"stargazers_count":98,"open_issues_count":7,"forks_count":9,"subscribers_count":19,"default_branch":"main","last_synced_at":"2024-11-10T09:34:38.885Z","etag":null,"topics":["sql"],"latest_commit_sha":null,"homepage":"https://twitter.com/largedatabank/status/1559651463919452161","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/airbytehq.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}},"created_at":"2022-08-17T16:07:03.000Z","updated_at":"2024-09-04T05:19:37.000Z","dependencies_parsed_at":"2024-11-10T09:27:57.743Z","dependency_job_id":"6fc6a86d-c317-433c-a5f0-0be1f16ccdf1","html_url":"https://github.com/airbytehq/SQL-Levels-Explained","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airbytehq%2FSQL-Levels-Explained","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airbytehq%2FSQL-Levels-Explained/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airbytehq%2FSQL-Levels-Explained/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airbytehq%2FSQL-Levels-Explained/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/airbytehq","download_url":"https://codeload.github.com/airbytehq/SQL-Levels-Explained/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225657318,"owners_count":17503544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["sql"],"created_at":"2024-08-04T15:01:46.126Z","updated_at":"2024-11-21T01:30:46.968Z","avatar_url":"https://github.com/airbytehq.png","language":null,"readme":"# SQL-Levels-Explained\n\nExplaining sql levels based on one meme:\n\n\u003cimg src=\"https://user-images.githubusercontent.com/6764957/185188888-e06ef45b-c749-4f19-b918-1d3530f4f634.png\" height=300 /\u003e\n\nIf you're replicating SQL databases, whether MySQL, Postgres, or SQL Server, [check out Airbyte](https://www.theseattledataguy.com/what-is-airbyte-and-why-you-should-use-it/)!\n\n## Level 0\n\n- Concepts\n  - ORMs\n  - data types\n  - foreign keys\n  - indexes\n- SQL: Just go through https://mode.com/sql-tutorial/\n  - SELECT/INSERT/UPDATE/DELETE\n    - SELECT DISTINCT\n  - ORDER BY\n  - GROUP BY\n  - LIMIT/OFFSET\n  - CREATE TABLE\n  - JOIN\n\n\n## Level 1\n\n- Concepts\n  - ACID\n  - transactions\n  - keyset pagination\n  - normal forms\n  - computed columns\n  - stored columns\n  - inverted indexes\n  - window functions\n- SQL\n  - outer joins\n  - ORDER BY in aggregates\n  - CTEs\n  - query plans and EXPLAIN\n\n## Level 2\n\n- Concepts\n  - Connection pools\n  - plan hints\n  - cursors\n  - MVCC garbage collection\n  - recursive CTEs\n  - LATERAL joins\n- Insights\n  - ORMs create bad queries: *explanation needed*\n  - optimizers don't work without table statistics: *explanation needed*\n  - there are no non-nullable types: *explanation needed*\n  \n## Level 3\n\n- Concepts\n  - MERGE\n  - COUNT(*) vs COUNT(1): https://svenweller.wordpress.com/2016/10/11/otn-apprecition-day-the-otn-forum/\n  - isolation levels\n  - zigzag join\n  - grouping sets, cube, rollup\n  - write skew\n  - partial indexes\n  - sharding\n  - phantom reads\n  - triggers\n- Insights\n  - serializable restarts require retry loops on all statements: *explanation needed*\n  - generator functions zip when cross joined: *explanation needed*\n  \n## Level 4\n\n- Concepts\n  - SELECT FOR UPDATE\n  - denormalization\n  - transaction contention\n  - sargability\n  - star schemas\n  - utf8mb4\n- Insights\n  - Ascending Key Problem: *explanation needed*\n  - Ambiguous network errors: *explanation needed*\n  - NULLs in CHECK constraints are truthy: *explanation needed*\n  \n## Level 5\n\n- Concepts\n  - DEFERRABLE INITIALLY IMMEDIATE\n  - MATCH PARTIAL foreign keys\n  - EXPLAIN approximates SELECT COUNT(*)\n  - causual reverse\n- Insights\n  - TPCC requires wait times: *explanation needed*\n  - cost models don't reflect reality: *explanation needed*\n  - 'null'::jsonb IS NULL = false: *explanation needed*\n\n## Level 6\n  \n- Concepts\n  - database cracking: *explanation needed*\n  - learned indexes: *explanation needed*\n  - XTID exhaustion: *explanation needed*\n  - Worst Case Optimal Join: *explanation needed*\n  - Volcano model: *explanation needed*\n- Battle Scars\n  - Vectorized doesn't mean SIMD: *explanation needed*\n  - join ordering is NP hard: *explanation needed*\n  - NULLs are equal in DISTINCT but inequal in UNIQUE: *explanation needed*\n\n\n## Level 7\n\n\n- dee and dum: https://blog.jooq.org/creating-tables-dum-and-dee-in-postgresql/\n- the Halloween problem: https://en.wikipedia.org/wiki/Halloween_Problem\n- allballs: https://www.postgresql.org/message-id/24526.1106597936%40sss.pgh.pa.us\n- fsyncgate: *explanation needed*\n- Every SQL operator is actually a JOIN: *explanation needed*\n- SERIAL is non-transactional: *explanation needed*\n- NULL (?): *explanation needed*\n","funding_links":[],"categories":["Others"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fairbytehq%2FSQL-Levels-Explained","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fairbytehq%2FSQL-Levels-Explained","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fairbytehq%2FSQL-Levels-Explained/lists"}