Lesson 18

Introducing Databases

In this lesson you learn about databases, what they are, how to figure out what to put in them, and how to organize them so that you can retrieve the information you need when you need it. Most of the information is true for most databases, but the information covered is in the context of the relational database system MySQL.

What Is a Database?

Databases have terminology all their own. Several terms are also used interchangeably:

  • Database: A database is an organized collection of data. In MySQL you often create separate databases for each of your projects.
  • Table: A table is a collection of similar information. In MySQL you might have a Customers table that contains data about your customers, a Products table that has data about your products, an Order Headers table that contains header and totals about your orders, and an Order Details table that contains the line items on the orders.
  • Row: Inside a table, you have rows. Each row is a related set of data. In the Customers table, each customer is in a row.
  • Record: A record is another word for a row.
  • Column: Inside your table you also have columns. Columns are the types of information you are storing in your table. For instance in the Customers table, name, street, and city would all be columns.
  • Field: A field is another word for a column. Sometimes used to refer to a specific row's column.
  • Value: A value is what is in a given cell. In the Customers table, for instance, you would have a row for George ...

Get PHP and MySQL® 24-Hour Trainer now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.