Chapter 2. Creating and Populating a Database

This chapter provides you with the information you need to create your first database and to create the tables and associated data used for the examples in this book. You will also learn about various data types and see how to create tables using them. Because the examples in this book are executed against a MySQL database, this chapter is somewhat skewed toward MySQL’s features and syntax, but most concepts are applicable to any server.

Creating a MySQL Database

If you already have a MySQL database server available for your use, you can skip the installation instructions and start with the instructions in Table 2-1. Keep in mind, however, that this book assumes that you are using MySQL version 6.0 or later, so you may want to consider upgrading your server or installing another server if you are using an earlier release.

The following instructions show you the minimum steps required to install a MySQL 6.0 server on a Windows computer:

  1. Go to the download page for the MySQL Database Server at http://dev.mysql.com/downloads. If you are loading version 6.0, the full URL is http://dev.mysql.com/downloads/mysql/6.0.html.

  2. Download the Windows Essentials (x86) package, which includes only the commonly used tools.

  3. When asked “Do you want to run or save this file?” click Run.

  4. The MySQL Server 6.0—Setup Wizard window appears. Click Next.

  5. Activate the Typical Install radio button, and click Next.

  6. Click Install.

  7. A MySQL Enterprise window appears. Click Next ...

Get Learning SQL, 2nd Edition 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.