Insert into two tables with transaction

SQL Medium 3 views
Back to Questions

Problem Description

Place an order and its order items together. If item insert fails, order should not be created.

Input Format

SQL script

Output Format

Statements

Sample Test Case

Input:
Orders, OrderItems
Output:
All or nothing

Constraints

Use transaction

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next