0
0
PostgreSQLquery~10 mins

Serializable isolation in PostgreSQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the transaction isolation level to serializable in PostgreSQL.

PostgreSQL
BEGIN TRANSACTION ISOLATION LEVEL [1];
Drag options to blanks, or click blank then click option'
Aserializable
Bread committed
Crepeatable read
Dread uncommitted
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'read committed' which is the default but less strict.
Confusing 'repeatable read' with 'serializable'.
2fill in blank
medium

Complete the code to start a transaction with serializable isolation level using the SET command.

PostgreSQL
SET TRANSACTION ISOLATION LEVEL [1];
Drag options to blanks, or click blank then click option'
Aserializable
Bread uncommitted
Crepeatable read
Dread committed
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'read uncommitted' which is not supported in PostgreSQL.
Using 'repeatable read' which is less strict than serializable.
3fill in blank
hard

Fix the error in the code to correctly set the isolation level to serializable.

PostgreSQL
BEGIN TRANSACTION ISOLATION [1];
Drag options to blanks, or click blank then click option'
Aserializable level
Blevel serializable
Cserializable
Disolation level serializable
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the word 'LEVEL' after 'ISOLATION'.
Swapping the order of 'serializable' and 'level'.
4fill in blank
hard

Fill both blanks to write a query that sets the isolation level to serializable and starts a transaction.

PostgreSQL
[1] TRANSACTION ISOLATION [2] serializable;
Drag options to blanks, or click blank then click option'
ABEGIN
BCOMMIT
CLEVEL
DROLLBACK
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'COMMIT' or 'ROLLBACK' to start a transaction.
Omitting the 'LEVEL' keyword.
5fill in blank
hard

Fill all three blanks to write a transaction block that sets serializable isolation, inserts a row, and commits.

PostgreSQL
[1] TRANSACTION ISOLATION LEVEL serializable;
INSERT INTO accounts (id, balance) VALUES (1, 1000);
[2];
Drag options to blanks, or click blank then click option'
ABEGIN
BCOMMIT
CROLLBACK
DSTART
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'START' instead of 'BEGIN'.
Using 'ROLLBACK' instead of 'COMMIT'.