employee_id | date | job_title_id | salary ———-…
employee_id | date | job_title_id | salary ————-+————+————–+——– 1 | 2020-01-01 | 1 | 50000 1 | 2020-06-01 | 2 | 45000 2 | 2020-01-01 | 1 | 50000 3 | 2020-01-01 | 1 | 50000 4 | 2020-01-01 | 2 | 45000 5 | 2020-01-01 | 2 | 45000(6 rows) Assume that the two following transactions are happening concurrently on the above table called employee_salary in Postgres. What is the output of “SELECT date FROM employee_salary WHERE employee_id = 2;” in (7), if each statement is performed in the order in the parenthesis? BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; –(2)SELECT * FROM employee_salary; –(3)UPDATE employee_salary SET date = ‘2020-03-01’ WHERE employee_id = 2; –(5)SELECT date FROM employee_salary WHERE employee_id = 2; –(7)COMMIT; –(8) BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; ; –(1)UPDATE employee_salary SET date = ‘2020-02-01’ WHERE employee_id = 2; –(4)COMMIT; –(6)
Read Details