Terminology: Relational Database

Data are the values kept in the database. Information is processed data. A database is a collection of tables, also called entities. Each table is made up of records (horizontal rows in the table). Each record should be unique, and can be stored in any order in the table. Each record is made up of fields (vertical columns of the table).

images/coding/coding01.webp

So, each table consists of many rows and columns. Each new row contains data about one single entity (such as one product or one user). This is called a record. Each column (also called an attribute) contains one piece of data that relates to the record.

The fields can be of various types, known as Data Types. A field is said to contain a null value when it contains nothing.

A key accesses specific records in a table. An index is a mechanism to improve the performance of a database.

A one-to-one (1:1) relationship is where for each instance of the first table in a relationship, only one instance of the second table exists.

A one-to-many (1:N) relationship is where for each instance of the first table in a relationship, many instances of the second table exist.

A many-to-many (M:N) relationship occurs where, for each instance of the first table, there are many instances of the second table, and for each instance of the second table, there are many instances of the first.

A mandatory relationship exists where for each instance of the first table in a relationship, one or more instances of the second must exist. An optional relationship is where for each instance of the first table in a relationship, there may exist instances of the second.

Data integrity refers to the condition where data is accurate, valid, and consistent. An example of poor integrity would be if a customer telephone number is stored differently in two different locations. Database normalisation is a technique that minimises the risk of these sorts of problems.