Create an audit table for triggers later

Create an audit table for triggers later

Hard SQL DDL 22 views
Explanation Complexity

Problem Statement

Create AuditLog(audit_id, table_name, row_id, action, changed_at).

Input Format

SQL DDL

Output Format

DDL statement(s)

Example

None
AuditLog created

Constraints

None

Input / Output Format

Input Format
SQL DDL
Output Format
DDL statement(s)
Constraints
None

Examples

Input:
None
Output:
AuditLog created

Example Solution (Public)

SQL
CREATE TABLE AuditLog (audit_id INT PRIMARY KEY, table_name VARCHAR(50) NOT NULL, row_id INT NOT NULL, action VARCHAR(20) NOT NULL, changed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP);

Official Solution Code

CREATE TABLE AuditLog (audit_id INT PRIMARY KEY, table_name VARCHAR(50) NOT NULL, row_id INT NOT NULL, action VARCHAR(20) NOT NULL, changed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.