Pages in this set

Page 1

Preview of page 1
Chapter 5




Chapter 5: Relational database concepts




o Table
Tables contain data about certain `things' for example a names of students, orders, customers,
suppliers, etc. A table is a data structure made up of rows and columns about the items

For a data structure to be called a table it…

Page 2

Preview of page 2
Chapter 5




o Record
A record is a single row within a table. It is the collection of data about a single item or single
occurrence. For example, a record might be about an individual, such as a student, and their
attendance etc.

Records are made up of fields and…

Page 3

Preview of page 3
Chapter 5




The primary key can be of two types:

Simple
Compound/composite

A simple primary key is one which is made up of a single field, for example only an ID
representing the unique column in a table.

Where a key is one, which combines more than one field to…

Page 4

Preview of page 4
Chapter 5




Secondary key

This is a field that is indentified as being suitable for indexing data. It is used to sort the data in a
different order to the primary key. A table can have many secondary keys ­ every field could be a
secondary key.

Foreign key

A…

Page 5

Preview of page 5
Chapter 5




Specifying the relationship is known as stating: "the degree of the relationship"

One-to-one relationship

The entity on one side is related to many entities on the other. For example:

­ Publisher to Books

· A publisher may publish many books, but a book is only published by a…

Page 6

Preview of page 6
Chapter 5




One-to-many relationship

This is the most common type of relationship between entities. Within the relationship it is true
that many instances of an entity are associated with only a single instance of another entity.




Many-to-many relationship

Many instances of an entity can be associated with many instances of…

Page 7

Preview of page 7
Chapter 5




When resolving many-to many relationships, the foreign key is on the many side, and the
primary key is on the one side.



o Entities and attributes
An entity is a name for a logical or physical storage unit. In simpler terms, an entity is the name
given to…

Page 8

Preview of page 8
Chapter 5




o Tables and Fields
A database table is made up of fields. The field holds an individual item of information. The field
is indentified by the name and is given a data type. Validation rules can also be applied to the
fields.
A table such as the one…

Page 9

Preview of page 9
Chapter 5




o Referential integrity

Referential integrity makes sure that it is impossible to enter a reference to a link which does
not exist.

For example using the paint shop, it is possible to have a supplier in the database who did not
supply the company with any paints. They…

Page 10

Preview of page 10
Chapter 5




Checks for 1NF:
Does the table have a primary key?
Is each field name unique?
Are there any repeating fields in a single record?
Is all the data within a field atomic?

Official Definition:
At the end of 1NF you end up with a table. In order to…

Comments

Mr A Gibson

An easy to understand, comprehensive set of notes about relational databases that would be great for any student - includes a decent explanation of queries up to the use of SQL. This would be great on your mobile device to refer to and read...

Similar ICT resources:

See all ICT resources »See all resources »