Mix DDL and TCL safely
SQL
Medium
3 views
Problem Description
You need to create a table and then insert rows. Write a script with commit. Mention in description that some DBs auto-commit DDL.
Sample Test Case
Output:
Table and rows created
Constraints
DDL commit behavior varies
Official Solution
BEGIN; CREATE TABLE TempX(id INT PRIMARY KEY); INSERT INTO TempX(id) VALUES (1); COMMIT;
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!