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 Patients ( PatientID INT PRIMARY KEY AUTO_INCREMENT, Name VARCHAR(100) NOT NULL, Age INT NOT NULL, ContactInfo VARCHAR(255) ); -- Создание таблицы для персонала CREATE TABLE Staff ( StaffID INT PRIMARY KEY AUTO_INCREMENT, Name VARCHAR(100) NOT NULL, Position VARCHAR(100), ContactInfo VARCHAR(255) ); -- Создание таблицы для операций CREATE TABLE Operations ( OperationID INT PRIMARY KEY AUTO_INCREMENT, Type VARCHAR(100) NOT NULL, DateTime DATETIME NOT NULL, Status VARCHAR(50), PatientID INT, StaffID INT, FOREIGN KEY (PatientID) REFERENCES Patients(PatientID), FOREIGN KEY (StaffID) REFERENCES Staff(StaffID) ); -- Создание таблицы для анализов CREATE TABLE Analysis ( AnalysisID INT PRIMARY KEY AUTO_INCREMENT, Type VARCHAR(100) NOT NULL, Result TEXT, PatientID INT, FOREIGN KEY (PatientID) REFERENCES Patients(PatientID) ); -- Создание таблицы для уведомлений CREATE TABLE Notifications ( NotificationID INT PRIMARY KEY AUTO_INCREMENT, Type VARCHAR(100) NOT NULL, Message TEXT NOT NULL, RecipientID INT, RecipientType ENUM('Patient', 'Staff'), FOREIGN KEY (RecipientID) REFERENCES Patients(PatientID) ON DELETE CASCADE ON UPDATE CASCADE ); -- Создание таблицы для подготовки операционных и пациентов CREATE TABLE Preparation ( PreparationID INT PRIMARY KEY AUTO_INCREMENT, OperationID INT NOT NULL, StaffID INT NOT NULL, Details TEXT, DateTime DATETIME NOT NULL, FOREIGN KEY (OperationID) REFERENCES Operations(OperationID), FOREIGN KEY (StaffID) REFERENCES Staff(StaffID) ); -- Создание таблицы для решений хирургов и анестезиологов CREATE TABLE Decisions ( DecisionID INT PRIMARY KEY AUTO_INCREMENT, OperationID INT NOT NULL, StaffID INT NOT NULL, DecisionText TEXT NOT NULL, DateTime DATETIME NOT NULL, FOREIGN KEY (OperationID) REFERENCES Operations(OperationID), FOREIGN KEY (StaffID) REFERENCES Staff(StaffID) ); -- Создание таблицы для логов технической поддержки CREATE TABLE SupportLogs ( LogID INT PRIMARY KEY AUTO_INCREMENT, StaffID INT NOT NULL, ActionType VARCHAR(100) NOT NULL, Description TEXT, DateTime DATETIME NOT NULL, FOREIGN KEY (StaffID) REFERENCES Staff(StaffID) ); -- Создание таблицы для результатов операций CREATE TABLE OperationResults ( ResultID INT PRIMARY KEY AUTO_INCREMENT, OperationID INT NOT NULL, PatientID INT NOT NULL, ResultDetails TEXT NOT NULL, DateTime DATETIME NOT NULL, FOREIGN KEY (OperationID) REFERENCES Operations(OperationID), FOREIGN KEY (PatientID) REFERENCES Patients(PatientID) );
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