Chapter 5 Relational Database Concepts

detailed notes on chapter 5 taken from the OCR book

HideShow resource information
  • Created by: Zara
  • Created on: 11-05-11 10:41
Preview of Chapter 5 Relational Database Concepts

First 102 words of the document:

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 must require the following:
The table must have a unique name
Each field/column must have a unique name
Each record/row must be unique
Each data item within a field must contain only a single data item
1 | Page
GO61 Revision

Other pages in this set

Page 2

Preview of page 2

Here's a taster:

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 can contain different data types. In a table, each record must
be unique.
o Field
A field is known as an individual item within a record. Each field should be given a unique name.…read more

Page 3

Preview of page 3

Here's a taster:

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.…read more

Page 4

Preview of page 4

Here's a taster:

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 foreign key is used to link tables together. A foreign key is a field in one table that is linked to
a primary key in another table.…read more

Page 5

Preview of page 5

Here's a taster:

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.…read more

Page 6

Preview of page 6

Here's a taster:

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 another entity.
If you have a many-to-many relationship, a link entity needs to be added. This is an entity that
sits between the two current entities and has one-to-many relationships with each.…read more

Page 7

Preview of page 7

Here's a taster:

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 anything you store data about. A list of all the paints in stock is an entity. All the data
items refer to the same thing: paint.…read more

Page 8

Preview of page 8

Here's a taster:

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 below is useful when planning a database:
o Records, keys and relationships
In order to see how the table works, it is necessary to look at the table with data in it.…read more

Page 9

Preview of page 9

Here's a taster:

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 may have done so in the past but you do not stock
any of their paints now. However, it is impossible to have paints in the database which do not
have a supplier.…read more

Page 10

Preview of page 10

Here's a taster:

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 be a table it must
have a primary key.…read more

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 »