MySQL table indexes and foreign keys
In this section, you will learn about table indexes and foreign keys and how to set them up in your database using MySQL Workbench. Most importantly, you will learn why you should use them. The following section begins with indexes.
Indexes
Do you remember the last time you looked up information in a large book (the old style one that is made of paper)? Perhaps it was a directory and you needed to look up a single person. Note that you didn't start on page one and read through every entry until you finally found them. Instead, you went to the index and scanned an alphabetized list until you found their name and the relevant page number. Then, you went directly to the page and found the person's details there.
An index of a database table is the same. The MySQL server can maintain an index on a column, and when you look for a record in that column, MySQL will find it for you more quickly. You can set up multiple indexes on most...