MySQL 9 Essentials was published on February 20, 2025.
The current revision is 1.0a. The revision of your book can be found on the copyright page at the start of the book.
The statement to display warning messages is SHOW WARNINGS, not SHOW WARNING:
SHOW WARNINGS;
+-------+------+-----------------------------------------------------+
| Level | Code | Message |
+-------+------+-----------------------------------------------------+
| Note | 1007 | Can't create database 'sampledb'; database exists |
+-------+------+-----------------------------------------------------+
1 row in set (0.00 sec)
Code language: plaintext (plaintext)
The first SELECT statement incorrectly capitalizes the product table name. It should read as follows:
SELECT * FROM product LIMIT 2;
The output from the final SELECT statement in this section should show the name column as follows:
SELECT name FROM product ORDER BY quantity;
+----------------------+
| name |
+----------------------+
| Mac Studio |
| iPhone 17 |
| iMac |
| iPhone 17 Pro |
| MacBook Air M3 |
| MacBook Pro M4 14-in |
| Mac Mini M3 |
+----------------------+
7 rows in set (0.000 sec)
Code language: plaintext (plaintext)
The example ALTER VIEW statement should read as follows:
ALTER VIEW desktop_computers
AS SELECT name, description FROM product
WHERE description LIKE '%desktop%' ORDER BY name;
Code language: plaintext (plaintext)
The example CREATE TABLE statement should read as follows:
CREATE TABLE poly (
id INT AUTO_INCREMENT PRIMARY KEY,
zone_name VARCHAR(100),
area POLYGON NOT NULL,
SPATIAL INDEX (area)
);
Code language: plaintext (plaintext)
If you have encountered an issue with the book not listed above, please contact us, and we will work to resolve the issue for you as quickly as possible.