Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
CREATE TABLE staffinfo ( emp_id INTEGER PRIMARY KEY, emp_nm VARCHAR(50) NOT NULL, birth_dt DATE NOT NULL, start_dt DATE NOT NULL, end_dt DATE ); INSERT INTO staffinfo (emp_id, emp_nm, birth_dt, start_dt, end_dt) VALUES (1, 'Ivanov', '1983-01-23', '2013-05-01', '2022-05-20'), (2, 'Petrov', '1985-02-20', '2014-01-23', '2021-06-22'), (3, 'Sidorov', '1980-04-01', '2015-05-05', NULL), (4, 'Petrov', '2003-01-23', '2024-02-02', NULL), (5, 'Vetrov', '2001-05-08', '2023-01-24', NULL); select emp_id from staffinfo where emp_nm = 'Petrov' UNION end_dt is null;

Stuck with a problem? Got Error? Ask AI support!

Copy Clear