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
WITH rent_data AS ( SELECT DATE(rental_date) AS rental_date, staff_id, COUNT(rental_id) AS rented_count FROM rental WHERE rental_date >= DATE('2005-07-01') AND rental_date < DATE('2005-08-01') GROUP BY rental_date, staff_id ) , return_data AS ( SELECT DATE(return_date) AS return_date, staff_id, COUNT(rental_id) AS returned_count FROM rental WHERE return_date >= DATE('2005-07-01') AND return_date < DATE('2005-08-01') GROUP BY return_date, staff_id ) -- , RECURSIVE July_daily AS ( -- SELECT DATE('2005-07-01') AS date -- UNION ALL -- SELECT DATE_ADD(date, INTERVAL 1 DAY) -- FROM July_daily -- WHERE date < '2005-07-31' -- ) SELECT * FROM rent_data rnd FULL OUTER JOIN return_data rtd ON rtd.return_date = rnd.rental_date AND rtd.staff_id = rnd.staff_id -- SELECT -- -- (CASE WHEN MONTH(rental_date) = 07 AND store_id = 1 THEN DATE(rental_date) ELSE NULL END) AS 'rent_1', -- (CASE WHEN MONTH(return_date) = 07 AND store_id = 1 THEN DATE(return_date) ELSE NULL END) AS 'return_1', -- (CASE WHEN MONTH(rental_date) = 07 AND store_id = 2 THEN DATE(rental_date) ELSE NULL END) AS 'rent_2', -- (CASE WHEN MONTH(return_date) = 07 AND store_id = 2 THEN DATE(return_date) ELSE NULL END) AS 'return_2' -- FROM rental r -- JOIN staff s USING(staff_id) -- WHERE MONTH(rental_date) = 07 OR MONTH(return_date) = 07;
SQL
Server:
MySQL 5.7
MySQL 5.7 Sakila (ReadOnly)
MySQL 8.0
MySQL 8.0 Sakila (ReadOnly)
MariaDB 11.5
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