Some Definitions

What is a Database?

A Database is:

  • a structured set of data held in a computer

  • a large collection of data organized especially for rapid search and retrieval

  • a collection of information that is organized so that it can be easily accessed, managed and updated.

The example below shows a staff database consisting of one table containing a row for each staff member. This is similar to a worksheet in an Excel spreadsheet.

table image

However, in the above example you can see that there is two sets of related information; information about staff members and departmental names. As you can see there is much repitition in the dept_name column. In cases such as this the two sets of related data can be separated into two separate tables. This will form a basic Relational Database

What is a Relational Database?

A Relational Database is:

A relational database is a collection of data items organised as a set of tables. Relationships can be defined between the data in one table and the data in another or many other tables. The relational database system will provide mechanisms by which you can query the data in the tables, re-assemble the data in various ways without altering the data in the actual tables. This querying is usually done using SQL (Structured Query Language). This is a relatively straight forward language to learn, certainly for simple queries.

To transform our original staff database into a relational database we would create a departments table to hold the name of each unique department and link it to the staff table using the dept_id which is common in both fields. The following diagam illustrates this.

relationship image

How does the database represent missing data?

All relational database systems have the concept of a NULL value. NULL represents something which is simply not known. When you create a database table, for each column you are allowed to indicate whether or not it can contain the NULL value. This can be used as a form of data validation. In many real life situations you will have to accept that the data isn't perfect and will have to allow NULL or missing values in your table.