MySQL examples run on MariaDB. The tables and data are a hidden setup that runs before the reader's query, so every run starts from the same data.

SELECT author, COUNT(*) AS books, MIN(year) AS first
FROM book
GROUP BY author
ORDER BY first;

CREATE TABLE book (id INT PRIMARY KEY, title VARCHAR(60), author VARCHAR(40), year INT);
INSERT INTO book VALUES
 (1, 'Na Drini cuprija', 'Ivo Andric', 1945),
 (2, 'Prokleta avlija', 'Ivo Andric', 1954),
 (3, 'Dervis i smrt', 'Mesa Selimovic', 1966),
 (4, 'Seobe', 'Milos Crnjanski', 1929),
 (5, 'Tvrdjava', 'Mesa Selimovic', 1970);
Student
  1. Run the query, then change it: for example SELECT title FROM book WHERE year > 1950;
  2. An INSERT or DELETE changes only your temporary database.
Teacher
  1. In the dialog choose MySQL (MariaDB) and write CREATE TABLE and INSERT in the field for the hidden setup.
  2. Needs the CodeLab runner with MariaDB.