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 dept ( deptno NUMERIC(5) NOT NULL, deptname VARCHAR(20), location VARCHAR(50) ); CREATE OR REPLACE TRIGGER auto_increment_deptno BEFORE INSERT ON dept FOR EACH ROW BEGIN IF :NEW.deptno IS NULL THEN SELECT COALESCE(MAX(deptno), 0) + 1 INTO :NEW.deptno FROM dept

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

Copy Clear