A SQL table is a container for the database to hold your data. A kitchen table in my house might only hold a plate, a fork, and a cup. A table set for a fine French restaurant might hold several plates, a bowl, wine glasses, napkins, candles, and more silverware than you know what to do with. A table in a database can be the same way. Some will be very simple and others will have many components to it. You decide how you want to describe your data; each item you want to describe is a table. Let’s talk about some of the basic structures of a table. I think it will be helpful to continue the comparison to the sandwich counter. We mentioned that each container was a specific size and had a specific purpose. I shouldn’t put meat in the lettuce container and the reverse is also true. In the case of a table, I have these containers and I need to put something specific in each one. Each container is represented by a column, and the specific type of data that goes inside the column is called a data type.
**Add links for columns and datatypes**
The item we are trying to collect data on, and all the information about the item, makes up our row. This is also sometimes called a record.
We uniquely identify a row in a table by specifying one column to be a primary key.
Want to follow along on your own database?
Do you want to follow along with the examples? We have created a sample database you can use to follow along and try in your own database. Go to the download page and follow the instructions. Have fun on the SQL trail!