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
create table Leads ( leadId int not null, created_date datetime, industry varchar(10), PRIMARY KEY (leadId) ); create table Accounts ( accountId int not null, created_date datetime, revenue_range varchar(10), leadId int not null, FOREIGN KEY (leadId) REFERENCES Leads(leadId) ); insert into Leads values (1, '2020-01-01', 'a'), (2, '2020-01-02', 'b'), (3, '2020-01-03', 'c'), (4, '2020-02-01', 'd'), (5, '2020-03-01', 'e'); insert into Accounts values (1, '2020-01-03', '1k', 1), (2, '2020-03-10', '2k', 5), (3, '2020-02-03', '3k', 2); select -- l.leadId, -- l.created_date as LeadCreatedDate, -- a.created_date as AccountCreatedDate, -- ABS is used because it returns with minus sign AVG(ABS(DATEDIFF(l.created_date, a.created_date))) as AvgDifferenceInDaysBetweenCreation from Leads as l inner join Accounts as a on l.leadId = a.leadId;
SQL
Server:
MariaDB 11.4
MariaDB 11.5
MariaDB 10
MariaDB 10 Sakila (ReadOnly)
MySQL 8.0
MySQL 8.0 Sakila (ReadOnly)
SQLite 3
SQLite 3 Preloaded
PostgreSQL 10 Bookings (ReadOnly)
PostgreSQL 13
PostgreSQL 14
PostgreSQL 15
PostgreSQL 16
PostgreSQL 17
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