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 'employees' table CREATE TABLE employees ( employee_id INT PRIMARY KEY, first_name VARCHAR(100), last_name VARCHAR(100), salary DECIMAL(10, 2), department VARCHAR(50) ); -- Create 'audit_log' table to track changes CREATE TABLE audit_log ( audit_id INT AUTO_INCREMENT PRIMARY KEY, action VARCHAR(50), table_name VARCHAR(50), description TEXT, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); INSERT INTO employees (employee_id, first_name, last_name, salary, department) VALUES (1, 'John', 'Doe', 95000, 'HR'); UPDATE employees SET salary = 110000 WHERE employee_id = 1; SELECT * FROM audit_log;

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

Copy Clear