How to do it...

Select all data from the departments table of the employee database. You can use an asterisk (*) to select all columns from a table. It is not recommended to use it, you should always select only the data you need:

mysql> SELECT * FROM departments;+---------+--------------------+| dept_no | dept_name          |+---------+--------------------+| d009    | Customer Service   || d005    | Development        || d002    | Finance            || d003    | Human Resources    || d001    | Marketing          || d004    | Production         || d006    | Quality Management || d008    | Research           || d007    | Sales              |+---------+--------------------+9 rows in set (0.00 sec)

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.