Components of a database


Last week saw the start of what a relational database is about - and databases in general. This week takes it one stage further by looking at the component parts of what makes up a database. Some of you may be sitting there thinking, "Why do I need to know this? What's the point?" The point is so that you can expand your knowledge through books etc. When you do, you will come across the "Jargon" so it's important to know what these things are.

Tables, Columns and Rows

These three items form the building blocks of a database. They store the data that we want to save in our database.

Columns

Columns are akin to fields, that is, individual items of data that we wish to store. A customer's name, the price of a part, the date of an invoice are all examples of columns. They are also similar to the columns found in spreadsheets (the A, B, C etc along the top).

Rows

Rows are akin to records as they contain data of multiple columns (like the 1,2,3 etc in a spreadsheet). Unlike file records though, it is possible to extract only the columns you want to make up a row of data. Old "records" that computers read forced the computer to read EVERYTHING, even if you only wanted a tiny portion of the record. In databases, a row can be made up of as many or as few columns as you want. This makes reading data much more efficient - you fetch what you want.

Tables

A table is a logical group of columns. For example, you may have a table that stores details of customers' names and addresses. Another table would be used to store details of parts and yet another would be used for supplier's names and addresses.

It is the tables that make up the entire database and it is important that we do not duplicate data at all. Only keys would duplicate (and even then, on some tables - these would be unique).

Keys

Keys are used to relate one table for another. For example. A customer places an order for some parts. We need to store the customer's details, the parts ordered and the supplier of the parts (to ensure we have enough stock or place a new order to restock).

How do we "link" all this information together? How can we separate one customer's order from another? Suppose we have the following tables to store this information.

The copyright of the article Components of a database in PC Support is owned by Chris Cruickshank. Permission to republish Components of a database in print or online must be granted by the author in writing.

Go To Page: 1 2 3

Articles in this Topic    Discussions in this Topic