-- now add a READ lock
LOCK TABLE orders READ;
-- and try to write
-- get next order number
SELECT @ordernum:=MAX(orderNumber)+1 FROM orders;
-- add another order
INSERT INTO orders (orderNumber, orderDate, customerNumber)
  VALUES(@ordernum, '2022-11-04', 298);
-- ERROR
