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
drop table persons; create table persons ( id int, name varchar(100), gender varchar(10), location varchar(100)); insert into persons values (1, 'John', 'm', 'Los Angeles'); insert into persons values (2, 'Mike', 'm', 'Seattle'); insert into persons values (3, 'Ann', 'f', 'New York'); insert into persons values (4, 'Emily', 'f', 'Los Angeles'); -- Expected Output /* location | male_count | female_count Los Angeles | 1 | 1 New York | 0 | 1 Seattle. | 1 | 0 */ select location, count(gender) as male_count, count(gender) as female_count from persons where gender = 'm' group by location; create table user_events (id integer, event_user varchar(20), web_page varchar(20), start_time timestamp ); insert into user_events values (1, 'raj', 'home', to_timestamp('01-NOV-2020 14:01:00', 'dd-mon-yyyy hh24:mi:ss')); insert into user_events values (1, 'raj', 'page 1', to_timestamp('01-NOV-2020 14:02:00', 'dd-mon-yyyy hh24:mi:ss')); insert into user_events values (1, 'raj', 'page 3', to_timestamp('01-NOV-2020 14:05:00', 'dd-mon-yyyy hh24:mi:ss')); insert into user_events values (2, 'kumar', 'page 1', to_timestamp('01-NOV-2020 14:10:00', 'dd-mon-yyyy hh24:mi:ss')); insert into user_events values (2, 'kumar', 'page 2', to_timestamp('01-NOV-2020 14:20:00', 'dd-mon-yyyy hh24:mi:ss')); insert into user_events values (2, 'kumar', 'page 3', to_timestamp('01-NOV-2020 14:40:00', 'dd-mon-yyyy hh24:mi:ss')); select * from user_events;
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