Creating database schema

There are many ways of creating database tables and relationships in MySQL:

  • You can use data description language (DDL) statements directly at MySQL Command Prompt from the Terminal
  • You can use MySQL Workbench and create tables directly
  • You can create an entity-relationship diagram in MySQL Workbench, export it to create a DDL script, and then run this script to create tables and relationships

We will use the third option. If you just want to get the script to create tables and want to skip creating the ER diagram, then jump to the Script to create tables and relationships section of this chapter.

If you have not already installed MySQL and MySQL Workbench, then refer to Chapter 1, Introducing JEE and Eclipse, for ...

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.