Database seems to be one of those magical words that everyone can use and understand the main concept. “It’s where my stuff is stored,” is the most basic definition of a database, and most people don’t look too far beyond that. But, for those of you that are curious, here is a basic overview of how a Database works:
First, let’s break down the hierarchy for a database.
- A database server contains many (dozens, hundreds, thousands) databases.
- A database contains many tables.
- Each table can consist of a few or lots of columns.
- Rows populate a database, giving a value to each column in the respective table.
This is really much simpler than it sounds. Essentially, each table in a database is just a large Excel-like spreadsheet. Here is a visual representation to help you out: http://screencast.com/t/3yKOrVn0l
As you can see, each table within a Database has a significant amount of rows. This is the actual “data” part of the database. Each row has several “fields” which represent a piece of information that relates to the column it is in. For example, if we have a Table called Customers, we would expect it to have columns like Name, Address, Phone Number, Email, etc. Each one of those columns would be considered a field. In this table we could have rows filling out those fields, like so:
|Mike||313 Happy Lanefirstname.lastname@example.org|
|Chris||131 Main Streetemail@example.com|
|Jacob||442 North Trailfirstname.lastname@example.org|
Pretty simple, right? Now keep in mind, that this is the top-most level of the database. There are many, many other operations going on behind the scenes to actually organize and locate the data so that it can be presented in this neat grid layout. Things like indexes, keys, stored procedures, and many other features. But that is a topic for another day.