Creating tables in MySQL

Let's now create tables and relationships in the MySQL database by using the script created in the previous section.

Make sure that MySQL is running and there is an open connection to the server from MySQL Workbench (see Chapter 1, Introducing JEE and Eclipse, for more details):

  1. Create a new query tab (the first button in the toolbar) and paste the preceding script.
  2. Execute the query.
  3. At the end of the execution, refresh schemas in the left-hand pane. You should see the course_management schema and the tables created in it.
Figure 4.9: MySQL schema for the course management example

Get Java EE 8 Development with Eclipse 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.