Database Introduction

From SwinBrain

This page covers a quick introduction to databases, examining what a database is, why they are used, and ways of using them.

Introduction: The material in this page aims to introduce important concepts rather than provide a detailed examination of the topic.

What is a database?

Before we answer this question lets consider a typical business application. This application will have associated with it a large amount of data, for example the details of the products that the company sells. This data need to be managed so that it can be used by the company. Consider the company's product details, this information would be needed on the company's web site if they want customers to be able to view this. A database is a collection of data managed in a systematic way, in this case the data refers to product information. Typically this information is stored in records, where one record would represent one product in this case. This makes the database much like a file, containing details that can then be manipulated by a program.

Product Table
Product Code Name Cost
W123-a Widget type 3 $0.25
C156-e Large cog $5.40
W871 Small Widget type 7 $0.05
... ... ...
The program used to access and manage a database is called a Database Management System or DBMS for short. Examples of DBMSs are shown in the following list. Each of these DBMSs gives you the ability to manage databases that contain details you are interested in. While they are all different, with different strengths and weaknesses they all aim to manage data for you.
Create a database
Want to play around with your own database? Check out this how-to document.

Relational Databases

Data view of a table in a database

There are different ways of potentially managing data within a database. The most common form of database is the relational database. A relational database organises information in tables, where each table contains a number of rows (the records). Each row in a table can store a number of values in fields, where each field stores a single value. Looking at the Product Table above the entire thing illustrates a table, each row represents an individual product or record, and the individual values are stored in field within that record. Each record in this table has three fields, a Product Code field, a Name field, and a Cost field. A relational database stores data values in the tables, and can also define relationships between records, and data constraints.

Design view of a table in a database

Creating your own database involves defining the tables that it will contain, and the columns within the tables. The columns provide the fields for each row in the table. When specifying each column, you would define its name such as Product Code or Cost, and indicate the type of data stored there. For example the third column in the Product Table is called Cost and stores Currency values. The following table lists some of the different data types available in Microsoft Access.

Data Type Description
Text Can be used to store textual information of up to 255 characters
Memo Use this if you want the field to store more than 255 characters, a memo can store up to 64,000 characters
Number This is used to store numeric data (numbers)
Date/Time Is used to stores Dates and Times
Currency This stores currency values, while this is numeric data precision is more important so it is stored differently to ensure that it is accurate.
AutoNumber Used to create a automatic identifier for each row. The number is incremented by one for each new row (0, 1, 2, etc.)
Yes/No Used to store values that are True/False, Yes/No, On/Off, etc.


These links will provide you with starting points for examining details about databases.

Here are some external links that build on this further.

[edit]Links: Topic Brains
Return to Swin Brain