SQLize
Online
/
PHPize Online
/
SQLtest Online
A
A
A
Share
Donate
Blog
Popular
Donate
A
A
A
Share
Blog
Popular
SQLize.online is a free online SQL environment for quickly running, experimenting with and sharing code.
You can run your SQL code on top of the most popular RDBMS including MySQL, MariaDB, SQLite, PostgreSQL, Oracle and Microsoft SQL Server.
SQL code:
Upload
Copy
Format
Clear
-- SELECT * -- FROM pg_type; CREATE OR REPLACE FUNCTION f_merge_ranges(oid, text, text) RETURNS text IMMUTABLE STRICT LANGUAGE plpgsql AS $$ DECLARE raw_range text; merged_ranges text; BEGIN IF $1 = 23 THEN raw_range := 'int4range(' || $2 || ', ' || $3 || ')'; ELSIF $1 = 1082 THEN raw_range := 'daterange(' || quote_literal($2) || ', ' || quote_literal($3) || ')'; ELSE RAISE ''; END IF; EXECUTE 'SELECT ' || raw_range || '::text;' INTO merged_ranges; RETURN merged_ranges; END; $$; -- SELECT f_merge_ranges(1082, '2022-01-01', '2022-02-01'); EXPLAIN ANALYZE SELECT 1 FROM generate_series(1, 200000) s -- WHERE CASE -- WHEN s >= 30000 AND s < 50000 THEN TRUE -- WHEN s >= 50000 AND s < 70000 THEN TRUE -- WHEN s >= 70000 AND s < 90000 THEN TRUE -- ELSE FALSE END WHERE s <@ int4range(30000, 90000);
SQL
Server:
MariaDB 11.4
MariaDB 11.5
MariaDB 10
MariaDB 10 Sakila (ReadOnly)
MySQL 5.7
MySQL 5.7 Sakila (ReadOnly)
MySQL 8.0
MySQL 8.0 Sakila (ReadOnly)
SQLite 3
SQLite 3 Preloaded
PostgreSQL 10 Bookings (ReadOnly)
PostgreSQL 11
PostgreSQL 12
PostgreSQL 13
PostgreSQL 14
PostgreSQL 15
MS SQL Server 2017
MS SQL Server 2019
MS SQL Server 2022
MS SQL Server 2022 AdventureWorks (ReadOnly)
Firebird 4.0
Firebird 4.0 (Employee)
Oracle Database 19c (HR)
Oracle Database 21c
Oracle Database 23c Free
SOQOL
Version
ER Diagram
Preserve result
Stuck with a problem?
Got Error?
Ask ChatGPT!
Result:
Copy
Clear