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 tbl_employees ( emp_id INT AUTO_INCREMENT PRIMARY KEY, emp_name VARCHAR(50), emp_departmentid INT, emp_salary DECIMAL(10, 2) ); INSERT INTO tbl_employees(emp_name, emp_departmentid, emp_salary) VALUES ('Nicole', 2, 1421.42), ('Michael', 3, 4262.53), ('Vince', 1, 6314.96), ('Kobe', 2, 8361.21), ('Bryan', 3, 3626.64), ('Loki', 1, 1332.12), ('Tomo', 3, 12242.88), ('Vilma', 3, 6327.24), ('Petra', 1, 4829.84); -- Drop the Function DROP FUNCTION IF EXISTS fn_getEmpNameByID; -- Create the Function DELIMITER $$ CREATE FUNCTION fn_getEmpNameByID(_id INT) RETURNS VARCHAR(50) BEGIN DECLARE _EmpName VARCHAR(50); SELECT emp_name INTO _EmpName FROM tbl_employees WHERE _id = emp_id; RETURN _EmpName; END $$ DELIMITER ; -- EXECUTE SELECT fn_getEmpNameByID(1); -- SELECT fn_getEmpNameByID(2); -- SELECT fn_getEmpNameByID(3); -- SELECT fn_getEmpNameByID(4); -- SELECT fn_getEmpNameByID(5); -- SELECT fn_getEmpNameByID(6); -- SELECT fn_getEmpNameByID(10); SELECT * FROM tbl_employees;
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
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