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 user, host FROM mysql.user; SHOW DATABASES; SHOW PROCESSLIST; SHOW GRANTS; -- echo "CREATE USER "${domain}"@"localhost" IDENTIFIED BY \"${dbup}\";" | mysql -u root -p"${dbrp}" -- echo "CREATE DATABASE ${domain};" | mysql -u root -p"${dbrp}" -- echo "GRANT ALL PRIVILEGES ON ${domain}.* TO ${domain}@localhost;" | mysql -u root -p"${dbrp}" -- CREATE USER domain @ localhost IDENTIFIED BY dbup; | mysql -u root -p dbrp -- CREATE DATABASE domain; | mysql -u root -p dbrp -- GRANT ALL PRIVILEGES ON domain.* TO domain @localhost; | mysql -u root -p dbrp -- SELECT * FROM information_schema.processlist; -- SELECT ID , user, host, db, command -- FROM information_schema.processlist -- WHERE ID = CONNECTION_ID(); -- CREATE USER IF NOT EXISTS 'emp_read_only'@'localhost' IDENTIFIED BY 'TestPassword'; -- SELECT * FROM mysql.user; -- SELECT user(); -- SELECT current_user(); -- SELECT DATABASE(); DROP TABLE IF EXISTS `student1`; -- CREATE TABLE table_name -- ( -- column_name1 data_type(size), -- column_name2 data_type(size), -- column_name3 data_type(size), -- ); CREATE TABLE `student1` ( `id` int(10) NOT NULL AUTO_INCREMENT, `name` varchar(15) DEFAULT NULL, `sex` char(4) DEFAULT NULL, `address` varchar(20) DEFAULT NULL, `hobby` varchar(30) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; -- insert into `student1`(`id`,`name`,`sex`,`address`,`hobby`) values (1,'张飞','男','河南省','游泳'),(6,'大乔','女','新疆省','游泳'),(10,'周瑜','男','陕西','游泳'),(16,'曹操','女','巴西','游泳'),(17,'张三','女','陕西','篮球'); DROP TABLE IF EXISTS `student2`; CREATE TABLE `student2` ( `id` int(10) NOT NULL AUTO_INCREMENT, `name` varchar(15) DEFAULT NULL, `sex` char(4) DEFAULT NULL, `address` varchar(20) DEFAULT NULL, `hobby` varchar(30) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; CREATE TEMPORARY TABLE student3 ( `id` int(10) NOT NULL AUTO_INCREMENT, `name` varchar(15) DEFAULT NULL, `sex` char(4) DEFAULT NULL, `address` varchar(20) DEFAULT NULL, `hobby` varchar(30) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; DESC student1; -- SHOW DATABASES; SHOW TABLES; -- use information_schema; -- SHOW TABLES; -- use sakila; -- SHOW TABLES; -- SELECT DATABASE(); /* -- 创建临时表 CREATE TEMPORARY TABLE temp_orders AS SELECT * FROM orders WHERE order_date >= '2023-01-01'; -- 查询临时表 SELECT * FROM temp_orders; -- 插入数据到临时表 INSERT INTO temp_orders (order_id, customer_id, order_date) VALUES (1001, 1, '2023-01-05'); -- 查询临时表 SELECT * FROM temp_orders; -- 删除临时表 DROP TEMPORARY TABLE IF EXISTS temp_orders; */
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