Advertisement
kish-dev

console_2

Apr 3rd, 2022 (edited)
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. -- 1.4
  2. BEGIN ISOLATION LEVEL READ COMMITTED;
  3.  
  4. SELECT pilot_name FROM results
  5. WHERE id = 1;
  6.  
  7. UPDATE results SET pilot_name = 'Lewis' WHERE id = 1;
  8.  
  9. SELECT pilot_name FROM results
  10. WHERE id = 1;
  11.  
  12. COMMIT;
  13.  
  14.  
  15. BEGIN ISOLATION LEVEL READ COMMITTED;
  16.  
  17. INSERT INTO results( stable_id, stage_id, laps_count, pilot_name, race_time, pit_stop_count, place)
  18. VALUES ( 1, 1, 50, 'Lewis', '3:12:5', 2, 1);
  19.  
  20. COMMIT;
  21.  
  22.  
  23. BEGIN ISOLATION LEVEL REPEATABLE READ;
  24.  
  25. INSERT INTO results(stable_id, stage_id, laps_count, pilot_name, race_time, pit_stop_count, place)
  26. VALUES (1, 1, 50, 'Lewis', '3:12:5', 2, 1);
  27.  
  28. COMMIT;
  29.  
  30.  
  31.  
  32. BEGIN ISOLATION LEVEL SERIALIZABLE;
  33.  
  34. INSERT INTO results(stable_id, stage_id, laps_count, pilot_name, race_time, pit_stop_count, place)
  35. VALUES (1, 1, 50, 'Lewis', '3:12:5', 2, 1);
  36.  
  37. COMMIT;
  38.  
  39.  
  40. select * from stables;
  41.  
  42. select * from stages;
  43.  
  44. select * from results;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement