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
SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for departamento -- ---------------------------- DROP TABLE IF EXISTS `departamento`; CREATE TABLE `departamento` ( `nome_depto` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL, `numero_depto` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, PRIMARY KEY (`numero_depto`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for disciplina -- ---------------------------- DROP TABLE IF EXISTS `disciplina`; CREATE TABLE `disciplina` ( `nome` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL, `cod_disciplina` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, `carga_horaria` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL, PRIMARY KEY (`cod_disciplina`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for ministra -- ---------------------------- DROP TABLE IF EXISTS `ministra`; CREATE TABLE `ministra` ( `siape` int(11) NOT NULL, `cod_disciplina` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, `periodo` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, PRIMARY KEY (`periodo`, `cod_disciplina`, `siape`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for professor -- ---------------------------- DROP TABLE IF EXISTS `professor`; CREATE TABLE `professor` ( `nome` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL, `siape` int(11) NOT NULL, `categoria` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL, `salario` int(11) NULL DEFAULT NULL, `cod_depto` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL, PRIMARY KEY (`siape`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; SET FOREIGN_KEY_CHECKS = 1; -- Script para povoamento (inserir os dados) insert into professor values ('Maria', '1234', 'Adjunto 1', 1000, 'D001'); insert into professor values ('Pedro', '5678', 'Adjunto 2', 2000, 'D001'); insert into professor values ('José', '1122', 'Adjunto 1', 1500, 'D003'); insert into disciplina values ('Banco de Dados', 'IF976', '60h'); insert into disciplina values ('Programação 2', 'IF992', '60h'); insert into disciplina values ('Fundamentos de SI', 'IF973', '75h'); insert into departamento values ('Informação e Sistemas', 'D003'); insert into departamento values ('Tecnologia da Informação', 'D001'); insert into ministra values ('1234', 'IF973', '2013.1'); insert into ministra values ('1234', 'IF973', '2013.2'); insert into ministra values ('1234', 'IF992' , '2013.1'); insert into ministra values ('1234', 'IF965' , '2013.1'); insert into ministra values ('4466', 'IF976' , '2013.2'); insert into ministra values ('5678', 'IF973' , '2013.2'); insert into ministra values ('1122', 'IF973' , '2013.2'); insert into ministra values ('5678', 'IF973' , '2013.1'); select * from professor;
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