Skip to content
SQLSimplified
BackendQuestion 47 of 52

Two-Phase Commit (2PC)

Problem

You are coordinating transactions across two separate databases (e.g. shipping and billing). You need a protocol that guarantees both commit or abort. Write a query that outputs protocol with the value: "Two-Phase Commit (2PC) is a distributed transaction protocol that uses a prepare phase and a commit phase to guarantee atomicity across nodes."

Database Schema

This problem acts as a scratchpad. You will write your own DDL/DML or conceptual queries, so there is no predefined schema.

Try It

Loading playground environment...

Hint

Solution