Connect any database. Ask in plain English.

Try free
← Blog

Online SQL Compiler: 12 Free Ones Compared by Engine, Plus 10 Practice Exercises With Answers (2026)

Twelve free online SQL compilers, editors and fiddles compared on 2 December 2026 by the engines and versions they run, sample data, share links and accounts. db<>fiddle runs the most, from SQL Server 2025 to Oracle 26ai. Then ten practice exercises with real answers, the dialect differences we hit in SQLite, DuckDB and PostgreSQL, and a timed test: a GROUP BY on 1 million rows took 1.8 s in sql.js in the browser and 21 ms in native DuckDB.

Fastero Dev TeamFastero Dev Team2026-12-02

We read the pages of twelve free online SQL compilers on 2 December 2026 and wrote down what each one runs, what sample data it ships, how you save and share, and whether you need an account. Then we built one invented orders table of 1,000,000 rows and ran ten practice exercises on it in SQLite 3.50.4, DuckDB 2.0.1 and PostgreSQL 18.7, and timed the same query in SQLite compiled for the browser (sql.js, loaded from a CDN into a page on localhost) against the native engines.

The short answer: for the most engines with no account, use db<>fiddle: SQL Server 2017 to 2025, MySQL 5.5 to 9.7, Postgres 8.4 to 19, Oracle 11g to 26ai, SQLite, DuckDB and eight more, with sample schemas and permanent links. DB Fiddle covers MySQL, MariaDB, Postgres and SQLite with share links; SQL Fiddle and OneCompiler add SQL Server and Oracle. For Oracle on a real server, use Oracle's FreeSQL, which replaced Live SQL. To run SQL entirely in your browser, use the SQLite Fiddle, Programiz or DuckDB's shell. On our 1-million-row table a GROUP BY took 1.8 seconds in the browser's SQLite and 0.12 seconds in DuckDB's. Checked 2 December 2026.

Fastero

Connect your database. Ask questions. Get dashboards.

Postgres, BigQuery, Snowflake, and 10+ sources — live-connected, AI-powered, no dashboard builder learning curve.

Try free →

Free online SQL compilers compared

From each tool's own page, read 2 December 2026:

Tool Engines and versions Sample data Save and share Account
db<>fiddle SQL Server 2017–2025, MySQL 5.5–9.7, Postgres 8.4–19, Oracle 11g–26ai, SQLite 3.27–3.53, DuckDB 1.4 and 2.0, MariaDB, Db2, Firebird and more Sakila (MySQL), HR (Oracle 26ai), AdventureWorks (SQL Server 2022, 2025) Permanent link None
DB Fiddle MySQL 5.5–9, MariaDB 10–12, PostgreSQL 9.4–19 beta, SQLite 3.30–3.46 A one-column example table Public links, which can't be deleted Only for private fiddles, on a paid PRO plan
SQL Fiddle SQL Server, SQLite, PostgreSQL, MySQL, MariaDB, Oracle, Oracle PL/SQL; versions not shown A three-row Product table Share button Only for its AI chat and editor
OneCompiler MySQL, PostgreSQL, SQL Server, SQLite, Oracle 23c An EMPLOYEE example Share links Not stated
Programiz SQLite, run in your browser by sql.js Customers, Orders, Shippings Kept in your browser None to run
SQLite Online SQLite (WebAssembly), DuckDB and PGlite; its changelog also lists MariaDB, PostgreSQL and SQL Server Your own imports A saved link to its cloud Not stated
SQLite Fiddle (sqlite.org) The official SQLite shell, compiled to WebAssembly None; import a file Export the database None
Sqlime The latest SQLite, compiled to WebAssembly Any SQLite file or URL Private GitHub gists GitHub, only to save
DuckDB shell DuckDB, compiled to WebAssembly NYC Taxi, Star Trek and five more datasets Share button None
Oracle FreeSQL (was Live SQL) Oracle Database on Oracle's servers Tutorials and community scripts Links, with a free account Only to save or get a schema
PGlite REPL PostgreSQL compiled to WebAssembly None Not stated Not stated
W3Schools Try-SQL WebSQL in the browser, or a read-only copy on its server A Customers database None stated None

Size and time limits are rarely published. The ones that are: DuckDB says WebAssembly "limits the amount of available memory to 4 GB and browsers may impose even stricter limits"; the SQLite Fiddle sets no import limit but warns that "large databases may cause it to fail with an out-of-memory error"; sql.js keeps the whole database in memory; SQLite Online's changelog lists "no 4mb query limit" from December 2024. db<>fiddle runs each fiddle "on a real disposable VM, so please don't poll or loop." DB Fiddle, SQL Fiddle and OneCompiler don't publish limits. Mode, once a common free SQL editor, now shows "Try for free" and "Request demo" where its pricing page was, with no free plan listed.

The best online SQL compiler for each engine

  • MySQL: DB Fiddle (5.5 to 9) or db<>fiddle (5.5 to 9.7, with the Sakila sample on 8.0 and later). For a hosted MySQL you keep, see our free MySQL database guide.
  • PostgreSQL: db<>fiddle (8.4 to 19) or DB Fiddle (9.4 to 19 beta). PGlite runs Postgres inside the browser. For a free hosted Postgres, see free Postgres database hosting.
  • SQL Server: db<>fiddle (2017 to 2025, with AdventureWorks on 2022 and 2025), SQL Fiddle or OneCompiler. SQL Server limits rows with TOP, not LIMIT.
  • Oracle: FreeSQL runs on a real Oracle Database, and with a free account you get your own schema you can reach from SQLcl or VS Code. db<>fiddle has 11g to 26ai.
  • SQLite: the SQLite Fiddle is SQLite's own shell; Programiz, Sqlime and SQLite Online run it in the page too.
  • DuckDB: the DuckDB shell, or db<>fiddle's DuckDB 1.4 and 2.0.

DB Fiddle vs SQL Fiddle vs db<>fiddle

The three names are easy to mix up, and they're three different sites.

db<>fiddle (dbfiddle.uk), Jack Douglas's site, says it is "Free, no account needed". Every fiddle gets a permanent link, and everything submitted is CC0, though fiddles "are not enumerable, so if you don't publish a link they aren't visible to anyone else". It runs 14 engines, and its page counts 12,668,794 fiddles.

DB Fiddle (db-fiddle.com) has a schema pane and a query pane for MySQL, MariaDB, PostgreSQL and SQLite. Its terms say "You cannot delete public fiddles nor make them private"; private fiddles come with a paid PRO subscription.

SQL Fiddle (sqlfiddle.com) is now maintained by ZZZ Projects and says "SQL Fiddle is free to use and ad-free!" It runs seven dialects and adds AI chat and an AI editor, which need a login.

SQL in the browser, with nothing on a server

sql.js, the SQLite Fiddle, Sqlime, PGlite and the DuckDB shell are database engines compiled to WebAssembly: the page downloads the engine and runs your SQL on your own device. Nothing is sent anywhere, which also means nothing is saved unless you export it. The sql.js README puts the trade-off plainly: it "uses a virtual database file stored in memory, and thus doesn't persist the changes made to the database." Programiz's SQL editor is built this way: its page loads sql.js and three sample tables.

How fast is SQL in the browser?

We served a page from localhost that loads sql.js 1.17.0 (SQLite 3.54.1) from cdnjs and DuckDB-Wasm 1.32.0 (DuckDB 1.4.3) from jsDelivr, drove it with headless Edge 158 through playwright-core, and ran the same query on the same 1,000,000 invented orders: revenue by category and region, 24 result rows. Then we ran it in native SQLite and DuckDB from Python, and in PostgreSQL in a Docker container.

Bar chart of the same GROUP BY on 1 million rows: sql.js in Edge took 1,796 ms, native SQLite 1,392 ms, PostgreSQL 18.7 in Docker 229 ms, DuckDB-Wasm in Edge 118 ms and native DuckDB 2.0.1 21 ms, each the median of 7 runs

The same GROUP BY on 1,000,000 invented rows, median of 7 runs, measured 2 December 2026 on one Windows 11 laptop.

Three things stand out:

  • SQLite in the browser is close to native SQLite. sql.js took 1,796 ms against 1,392 ms natively on this query, and 8.2 seconds against 8.3 seconds across all ten exercises below. Practicing in Programiz or the SQLite Fiddle is not slow because it's in a browser; it's as fast as SQLite is.
  • DuckDB is a different class for this kind of query. Native DuckDB took 21 ms, 65 times faster than SQLite, because it stores each column separately and uses all cores. DuckDB-Wasm took 118 ms: five and a half times slower than native, since by default "the WebAssembly client only uses a single thread", and still 15 times faster than sql.js.
  • Loading is the cost you notice. sql.js read the 80 MB SQLite file in 336 ms and opened it in 28 ms, from localhost; over a home connection the download would dominate. DuckDB-Wasm took 1.4 s to start and 1.2 s to load a 12 MB Parquet copy of the table. A first pass minutes earlier gave 1,856 ms and 106 ms for the same query, so treat the numbers as about plus or minus 10%.

Practice SQL online: 10 exercises on one orders table

Each exercise below has the SQL and the real answer from our table. To practice on your own copy, paste this into shell.duckdb.org: it builds a million random orders with the same columns (a 12-product catalog rather than our 30, so your numbers will differ). We ran it in DuckDB-Wasm 1.32 in Edge, where it took 0.7 seconds.

CREATE TABLE products AS
SELECT * FROM (VALUES
  (0, 'Electronics', 'Monitor', 'ELE-0039', 219.0),
  (1, 'Electronics', 'Headphones', 'ELE-0025', 89.0),
  (2, 'Home', 'Desk lamp', 'HOM-0011', 34.0),
  (3, 'Home', 'Wall clock', 'HOM-0032', 31.0),
  (4, 'Office', 'Office chair', 'OFF-0039', 179.0),
  (5, 'Office', 'Notebook', 'OFF-0011', 6.5),
  (6, 'Outdoor', 'Tent', 'OUT-0032', 149.0),
  (7, 'Outdoor', 'Backpack', 'OUT-0018', 64.0),
  (8, 'Kitchen', 'Blender', 'KIT-0025', 79.0),
  (9, 'Kitchen', 'Chef knife', 'KIT-0011', 49.0),
  (10, 'Toys', 'Board game', 'TOY-0018', 36.0),
  (11, 'Toys', 'Kite', 'TOY-0039', 23.0)
) t(pid, category, product, sku, price);
 
CREATE TABLE orders AS
WITH r AS (
  SELECT i, CAST(floor(random() * 12) AS INTEGER) AS pid
  FROM range(1, 1000001) t(i)
)
SELECT
  i AS order_id,
  DATE '2024-01-01' + CAST(floor(random() * 1065) AS INTEGER) AS order_date,
  CAST(ceil(random() * 60000) AS INTEGER) AS customer_id,
  ['North', 'South', 'East', 'West'][CAST(ceil(random() * 4) AS INTEGER)] AS region,
  category, product, sku,
  CAST(ceil(random() * 3) AS INTEGER) AS quantity,
  CAST(price * (0.96 + random() * 0.08) AS DECIMAL(10, 2)) AS unit_price,
  [0, 0, 0, 0.05, 0.1, 0.2][CAST(ceil(random() * 6) AS INTEGER)] AS discount,
  CASE WHEN random() < 0.9 THEN 'completed' ELSE 'refunded' END AS status
FROM r JOIN products USING (pid);

An order's amount is quantity * unit_price * (1 - discount). The SQL below runs unchanged in SQLite, DuckDB and PostgreSQL except where noted, and all three gave the same answers.

1. How many orders are there, and over what dates?

SELECT COUNT(*) AS orders, MIN(order_date) AS first_day, MAX(order_date) AS last_day
FROM orders;
orders  | first_day  | last_day
1000000 | 2024-01-01 | 2026-11-30

2. The five biggest completed orders in November 2026 (filter, a computed column, ORDER BY and LIMIT).

SELECT order_id, order_date, product, quantity,
       ROUND(quantity * unit_price * (1 - discount), 2) AS amount
FROM orders
WHERE status = 'completed'
  AND order_date >= '2026-11-01' AND order_date < '2026-12-01'
ORDER BY amount DESC, order_id
LIMIT 5;
order_id | order_date | product | quantity | amount
996901   | 2026-11-29 | Monitor | 5        | 1176.35
988661   | 2026-11-23 | Monitor | 5        | 1164.55
967108   | 2026-11-08 | Monitor | 5        | 1160.15
981233   | 2026-11-19 | Monitor | 5        | 1154.80
999277   | 2026-11-30 | Monitor | 5        | 1152.20

3. Revenue by region (GROUP BY with SUM).

SELECT region, COUNT(*) AS orders,
       ROUND(SUM(quantity * unit_price * (1 - discount))) AS revenue
FROM orders
WHERE status = 'completed'
GROUP BY region
ORDER BY revenue DESC;
region | orders | revenue
North  | 270385 | 23014053
East   | 251720 | 21506394
West   | 198032 | 16945060
South  | 179833 | 15425777

4. Categories whose average completed order is over $60 (HAVING filters groups after GROUP BY).

SELECT category, ROUND(AVG(quantity * unit_price * (1 - discount)), 2) AS avg_order
FROM orders
WHERE status = 'completed'
GROUP BY category
HAVING AVG(quantity * unit_price * (1 - discount)) > 60
ORDER BY avg_order DESC;
category    | avg_order
Electronics | 137.97
Outdoor     | 107.4
Kitchen     | 78.37
Office      | 77.71

5. Monthly revenue in 2026. This is where dialects split. SQLite writes strftime('%Y-%m', order_date), DuckDB strftime(order_date, '%Y-%m') and PostgreSQL to_char(order_date, 'YYYY-MM'); DuckDB and PostgreSQL also have date_trunc('month', order_date). The DuckDB version:

SELECT strftime(order_date, '%Y-%m') AS month,
       ROUND(SUM(quantity * unit_price * (1 - discount))) AS revenue
FROM orders
WHERE status = 'completed' AND order_date >= DATE '2026-01-01'
GROUP BY month
ORDER BY month;
month   | revenue
2026-01 | 2479933
2026-02 | 2315847
2026-03 | 2586029
...       (April to September omitted)
2026-10 | 2910035
2026-11 | 3193704

6. Refund rate by category (CASE inside an aggregate). Write 100.0, not 100. In SQLite and PostgreSQL an integer divided by an integer drops the fraction: with 100, SQLite gave us 6 for Office instead of 6.07, and a plain refunds-over-orders share came back as 0.

SELECT category,
       ROUND(100.0 * SUM(CASE WHEN status = 'refunded' THEN 1 ELSE 0 END) / COUNT(*), 2) AS refund_pct
FROM orders
GROUP BY category
ORDER BY refund_pct DESC;
category    | refund_pct
Office      | 6.07
Electronics | 6.02
Kitchen     | 6.01
Outdoor     | 5.97
Home        | 5.94
Toys        | 5.92

7. Orders per SKU prefix (string functions). DuckDB and PostgreSQL have split_part(sku, '-', 1); SQLite doesn't, so this version uses substr and instr, which run in SQLite and DuckDB but not in PostgreSQL, which has no instr function:

SELECT substr(sku, 1, instr(sku, '-') - 1) AS prefix, COUNT(*) AS orders
FROM orders
GROUP BY prefix
ORDER BY orders DESC;
prefix | orders
ELE    | 232526
HOM    | 195595
OFF    | 168915
OUT    | 149370
KIT    | 133159
TOY    | 120435

8. How many customers spent more than the average customer? (a CTE and a scalar subquery).

WITH per_customer AS (
  SELECT customer_id, SUM(quantity * unit_price * (1 - discount)) AS spent
  FROM orders
  WHERE status = 'completed'
  GROUP BY customer_id
)
SELECT COUNT(*) AS customers,
       (SELECT COUNT(*) FROM per_customer) AS all_customers,
       ROUND((SELECT AVG(spent) FROM per_customer), 2) AS avg_spent
FROM per_customer
WHERE spent > (SELECT AVG(spent) FROM per_customer);
customers | all_customers | avg_spent
8271      | 43833         | 1754.19

Fewer than one in five customers beat the average, because a few big spenders pull the mean up.

9. The top two products in each category (a window function: RANK() OVER (PARTITION BY ...)). More patterns in our SQL window functions guide.

SELECT category, product, revenue, rnk
FROM (
  SELECT category, product,
         ROUND(SUM(quantity * unit_price * (1 - discount))) AS revenue,
         RANK() OVER (PARTITION BY category
                      ORDER BY SUM(quantity * unit_price * (1 - discount)) DESC) AS rnk
  FROM orders
  WHERE status = 'completed'
  GROUP BY category, product
) ranked
WHERE rnk <= 2
ORDER BY category, rnk;
category    | product         | revenue  | rnk
Electronics | Monitor         | 14936317 | 1
Electronics | Headphones      | 6577308  | 2
Home        | Desk lamp       | 2260864  | 1
Home        | Wall clock      | 1859083  | 2
...           (Kitchen, Office and Outdoor omitted)
Toys        | Building blocks | 1601292  | 1
Toys        | Board game      | 1383424  | 2

10. Month-over-month change (LAG, with the month written in DuckDB's dialect as in exercise 5).

WITH monthly AS (
  SELECT strftime(order_date, '%Y-%m') AS month,
         SUM(quantity * unit_price * (1 - discount)) AS revenue
  FROM orders
  WHERE status = 'completed' AND order_date >= DATE '2025-12-01'
  GROUP BY month
)
SELECT month, ROUND(revenue) AS revenue,
       ROUND(100.0 * (revenue - LAG(revenue) OVER (ORDER BY month))
             / LAG(revenue) OVER (ORDER BY month), 1) AS change_pct
FROM monthly
ORDER BY month;
month   | revenue | change_pct
2025-12 | 3056198 | NULL
2026-01 | 2479933 | -18.9
2026-02 | 2315847 | -6.6
...       (March to September omitted)
2026-10 | 2910035 | 4.8
2026-11 | 3193704 | 9.7

The first month has no previous month, so LAG returns NULL. For seventeen more worked queries, with joins, see SQL query examples.

Dot chart of how long each of the ten exercises took on 1 million rows in five engines, on a log scale: native DuckDB from 0.9 to 27 ms, DuckDB-Wasm from 4 to 299 ms, PostgreSQL from 40 to 348 ms, and SQLite and sql.js from about 160 ms to 1,984 ms, slowest on the RANK query

Median time per exercise in each engine on the same 1,000,000 invented rows, 2 December 2026.

Connect any database. Ask in plain English.

Start free →

Where SQL dialects differ, tested

We ran each snippet in all three engines on 2 December 2026. "Error" means the engine rejected it.

What you write SQLite 3.50.4 DuckDB 2.0.1 PostgreSQL 18.7
SELECT 7 / 2 3 3.5 3
Month from a date strftime('%Y-%m', d) strftime(d, '%Y-%m') to_char(d, 'YYYY-MM')
CAST('2026-11-30' AS DATE) 2026 2026-11-30 2026-11-30
30 days later date(d, '+30 days') d + INTERVAL 30 DAY d + 30
split_part('ELE-0011', '-', 1) Error: no such function ELE ELE
'Monitor' LIKE 'monitor' 1 (true) false false
ROUND(x, 2) on a double 2.35 2.35 Error: no round(double precision, integer)
FETCH FIRST 3 ROWS ONLY Error Works Works
QUALIFY RANK() OVER (...) = 1 Error Works Error
TOP 3 Error Error Error

The two that bite: SQLite has no date type, so CAST(... AS DATE) silently returns the year as a number and dates are compared as text; and SQLite's LIKE ignores case for ASCII letters. DuckDB also accepts strftime('%Y-%m', order_date) when the column is a real DATE, but not with two text literals. TOP is SQL Server's: Microsoft's docs say it "Limits the rows returned in a query result set to a specified number of rows or percentage of rows in SQL Server." Oracle uses FETCH FIRST too. The sample sales table in Fastero, below, speaks DuckDB's dialect.

Where Fastero fits

An online compiler is the right tool for a snippet, a Stack Overflow answer or a practice session: no sign-up and a link to share. Fastero is for the step after practice: SQL on data that's yours, saved in your workspace and rerun. Fastero is an AI and data platform where people and AI agents work together on a team's data. On the Free plan (no end date, no card):

  • A table to query on day one. Every new account comes with an invented sample: a sales table of made-up orders you can query in the SQL editor straight away, in DuckDB SQL, plus a sample dashboard, notebook and Streamlit app built on it.
  • Your own files. Upload a CSV or Excel file to a project (up to 100 MB a file, within the plan's 500 MB of storage) and query it with SQL.
  • Your own database. Connect Postgres, MySQL or SQL Server (or Redshift, Oracle or BigQuery) and run SQL on the saved connection.
  • Saved queries become charts and dashboards that refresh on a schedule, and colleagues open them with their own login; viewers are free. An AI agent can write and run the SQL for you, paid from a balance that starts at $20.

Fastero's SQL editor with a query that pivots leads by channel and month, run on a demo connection, its 12 result rows below, and Pin to Dashboard and Download CSV above the results

The SQL editor in Fastero, on a demo connection with invented marketing data.

If you're choosing a desktop or team SQL editor instead, see the best SQL editors for data teams, and for help writing the SQL, AI SQL query generators compared.

FAQ

What is the best free online SQL compiler?

For range, db<>fiddle: it runs SQL Server, MySQL, PostgreSQL, Oracle, SQLite, DuckDB and eight more engines, many in several versions, with no account and a permanent link for each fiddle. For a quick SQLite session, Programiz or the SQLite Fiddle run entirely in your browser.

Can I practice SQL Server online for free?

Yes. db<>fiddle runs SQL Server 2017, 2019, 2022 and 2025, with the AdventureWorks sample database on 2022 and 2025, and SQL Fiddle and OneCompiler also run SQL Server. Remember that SQL Server uses TOP where other engines use LIMIT.

Is DB Fiddle free?

Yes, for public fiddles, in MySQL, MariaDB, PostgreSQL and SQLite. Public fiddles can't be deleted or made private; private fiddles are part of a paid PRO subscription, whose price we didn't find published.

What replaced Oracle Live SQL?

Oracle FreeSQL. Oracle's Live SQL page now shows FreeSQL, which runs SQL on a real Oracle Database in the browser. You can run scripts without an account; a free account gives you a personal schema, saved scripts and share links.

Can I run SQL in the browser without a server?

Yes. sql.js, the SQLite Fiddle and Sqlime run SQLite compiled to WebAssembly, the DuckDB shell runs DuckDB, and PGlite runs PostgreSQL, all on your own device. Your data stays in the page's memory unless you export it.

How big a table can an online SQL editor handle?

In a browser engine, as much as the tab's memory allows: DuckDB says WebAssembly caps memory at 4 GB and browsers may set less. Our 1,000,000-row table, an 80 MB SQLite file, loaded in sql.js in under half a second from localhost and answered a GROUP BY in 1.8 seconds.

Is SQL Fiddle still working?

Yes. SQL Fiddle is maintained by ZZZ Projects, is free and ad-free, and runs SQL Server, SQLite, PostgreSQL, MySQL, MariaDB, Oracle and Oracle PL/SQL. Its AI chat and AI editor need a login.

Sources

Read on 2 December 2026:


Try Fastero free: query the sample sales table in the SQL editor the minute you sign up, then your own CSV files or database. No credit card required.

Ready to try it yourself?

Connect your database, ask questions in plain English, and get live dashboards — in under 2 minutes. No credit card required.

Follow Fastero on LinkedIn for new articles and examples.

Keep reading

Related articles

2026-12-03

Sample Databases for SQL Practice: 13 Free Ones Compared, With Row Counts From 847 to 103 Million (2026)

Northwind, Sakila, Pagila, Chinook, AdventureWorks, WideWorldImporters, the MySQL employees and world databases, TPC-H, TPC-DS, IMDb and Stack Overflow: where to get each, its licence, and the tables, rows and dates we counted in twelve of them on 3 December 2026. Their biggest tables run from 847 rows to 103 million, and five of the official install routes have a trap we hit, with the fix.

sqlsql-practicesample-data

2026-12-03

SQL Interview Questions: 34 With Answers Tested in DuckDB and PostgreSQL, Easy to Hard (2026)

34 SQL interview questions for data analyst, analytics engineer and data scientist roles, from GROUP BY to gaps and islands, each with SQL we ran in DuckDB 2.0.1 and PostgreSQL 16 and its real output. NOT IN returned 0 rows where NOT EXISTS returned 5, and on 40,000 rows a correlated subquery took 171 seconds in PostgreSQL against 27 ms for a window function.

sqlsql-interviewwindow-functions

2026-12-03

SQL Cheat Sheet: 42 Queries With Real Output, Tested in Postgres, MySQL, SQLite and DuckDB (2026)

The SQL people look up most, from SELECT, joins and GROUP BY to recursive CTEs, window functions and UPSERT, each run on a 4,734-row sample sales table with the output it returned. We ran the same 42 queries unchanged in four databases: PostgreSQL 16 matched DuckDB on 37, SQLite on 29 and MySQL 8.4 on 23. Plus a dialect table and an index that cut a lookup on a million rows from 59 ms to 0.03 ms.

sqlcheat-sheetpostgresql