4.Creating Databases, Tables, and Indexes

In this chapter you'll learn how to create all the basic MySQL structures: databases, tables, and indexes. We'll cover the following:

• Creating a database

• Selecting a database

• Creating tables

• Column and data types in MySQL

• Creating indexes

• Deleting databases, tables, and indexes

• Altering existing table structures

We will use a simple sample database for the examples in this chapter—this is the employee database we talked about in the preceding chapter. This is the database schema:

employee(employeeID, name, job, image)

department(departmentID, name)

employeeSkills( , skill)

client(

Get MySQL Tutorial 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.