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 Mitarbeiter ( ID INT PRIMARY KEY, Name VARCHAR(50), Age INT, Abteilung VARCHAR(50) ); INSERT INTO Mitarbeiter (ID, Name, Age, Abteilung) VALUES (1, 'Max Mustermann', 30, 'IT'), (2, 'Jane Smith', 35, 'HR'), (3, 'Alice Johnson', 25, 'Marketing'); CREATE INDEX idx_abteilung ON Mitarbeiter (Abteilung); SELECT * FROM Mitarbeiter WHERE Abteilung = 'IT'; CREATE TABLE Studenten ( student_id INT PRIMARY KEY, Name VARCHAR(50), Note VARCHAR(2) ) ENGINE = MEMORY; CREATE INDEX idx_note USING HASH ON Studenten (Note); INSERT INTO Studenten (student_id, Name, Note) VALUES (1, 'Mike Johnson', 'A'), (2, 'Sarah Parker', 'B'), (3, 'Tom Smith', 'C'); SELECT * FROM Studenten WHERE Note = 'A'; SHOW INDEX FROM Studenten; CREATE TABLE Artikel ( ID INT PRIMARY KEY, Titel VARCHAR(100), Inhalt TEXT ); INSERT INTO Artikel (ID, Titel, Inhalt) VALUES (1, 'Einführung in MySQL', 'MySQL ist ein beliebtes Open-Source-Datenbanksystem.'), (2, 'Erweiterte SQL-Techniken', 'Lernen Sie fortgeschrittene SQL-Techniken.'), (3, 'Datenbankdesign', 'Best Practices für den effizienten Datenbankentwurf.'); CREATE FULLTEXT INDEX idx_inhalt ON Artikel (Inhalt); SELECT * FROM Artikel WHERE MATCH(Inhalt) AGAINST ('MySQL'); CREATE TABLE Standorte ( ID INT PRIMARY KEY, Name VARCHAR(100), Koordinaten POINT ) ENGINE=MyISAM; INSERT INTO Standorte (ID, Name, Koordinaten) VALUES (1, 'Office', ST_GeomFromText('POINT(40.7128 -74.0060)')), (2, 'Home', ST_GeomFromText('POINT(34.0522 -118.2437)')), (3, 'Park', ST_GeomFromText('POINT(51.5074 -0.1278)')); ALTER TABLE Standorte MODIFY Koordinaten GEOMETRY NOT NULL; CREATE SPATIAL INDEX idx_koordinaten ON Standorte (Koordinaten); SELECT Koordinaten FROM Standorte; EXPLAIN SELECT * FROM Mitarbeiter WHERE Abteilung = 'IT'; DROP INDEX idx_abteilung ON Mitarbeiter; CREATE INDEX idx_abteilung ON Mitarbeiter (Abteilung); SELECT * FROM Mitarbeiter USE INDEX (idx_abteilung) WHERE Abteilung = 'IT'; EXPLAIN SELECT * FROM Mitarbeiter WHERE Abteilung = 'IT'; DROP INDEX idx_abteilung ON Mitarbeiter; CREATE INDEX idx_abteilung ON Mitarbeiter (Abteilung); SELECT * FROM Mitarbeiter USE INDEX (idx_abteilung) WHERE Abteilung = 'IT'; EXPLAIN SELECT * FROM Mitarbeiter WHERE Abteilung = 'IT'; CREATE TABLE Kunden ( ID INT PRIMARY KEY, Name VARCHAR(100), EMail VARCHAR(100) UNIQUE ); INSERT INTO Kunden (ID, Name, EMail) VALUES (1, 'John Doe', 'john@example.com'); SELECT * FROM Kunden WHERE EMail = 'john@example.com'; UPDATE Kunden SET Name = 'Jane Smith' WHERE EMail = 'john@example.com'; INSERT INTO Kunden (ID, Name, EMail) VALUES (2, 'Jane Smith', 'jane@example.com'); CREATE TABLE Orders ( ID INT PRIMARY KEY, OrderDate DATE ); CREATE TABLE Order_Details ( ID INT PRIMARY KEY, Order_ID INT, Item VARCHAR(100), Quantity INT, FOREIGN KEY (Order_ID) REFERENCES Orders (ID) ); SELECT * FROM Orders WHERE ID = 100; CREATE TABLE Inventar ( ID INT PRIMARY KEY, Produktname VARCHAR(100), Menge INT CHECK (Menge > 0) ); CREATE TABLE AndereTabelle ( ID INT PRIMARY KEY, Beschreibung VARCHAR(100) ); CREATE TABLE Beispiel ( ID INT, Name VARCHAR(100), CONSTRAINT PK_Beispiel PRIMARY KEY (ID), CONSTRAINT FK_Beispiel FOREIGN KEY (ID) REFERENCES AndereTabelle(ID) ); SELECT CONSTRAINT_NAME, CONSTRAINT_TYPE FROM information_schema.TABLE_CONSTRAINTS WHERE TABLE_NAME = 'Beispiel'; CREATE TABLE Orders ( OrderID INT PRIMARY KEY, KundenID INT );
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