databases. objectives define what a database is. understand the difference between a flat and...

15
Databases

Upload: david-neil-johns

Post on 24-Dec-2015

225 views

Category:

Documents


0 download

TRANSCRIPT

Databases

Objectives

Define what a database is.Understand the difference between a flat and

relational databaseDesign and create a relational database using

tables

Database definition

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

Example: A telephone book

Write down three other examples of databases (they do not have to be computer based)

Example of a database

Database termsTableA group of recordsExample: Class 11AB student detailsRecordA group of fields containing data about a

person, item etc.Example: Name and Address and Date of BirthFieldOne piece of information you want to use in

your databaseExample: Name, Date of BirthValueAn entry for a fieldExample: Paul, 07/02/1990

Flat database

A flat database is represented by a table which is made up of fields and records.

Flat databases are used to store limited amounts of information such as personal details.

Examples of Flat databases

Data types in AccessData Type Description

AutoNumberThis filed is automatically created for each record in your database. The AutoNumber field is primarily used for Primary Keys in Access. For example 1, 2, 3

TextA Text field can contain values that are text, numbers or both. For example, Fname, LName

Number The Number field can store numeric values up to 16 bytes of data.

Date/TimeThe Date/Time field allows storage of date and time information. For example, 10/11/2012

Yes/No Boolean data storage of true/false values. EG YES/NO

Field names and Datatypes

Primary Key

The primary key of a table uniquely identifies each record in the table.

This number can be given by Access or can be chosen by you.

What number could be used to uniquely identify you?

A relational database

A relational database stores data in a collection of related tables.

Each table contains one specific type of information.

This makes sure that data is stored only once, reducing the amount of duplicate data that is stored.

Example of a relational database

Create a database

Use the manual given to start designing and creating your database.

The database design process consists of several steps

1. Determine the purpose of your database.2. Gather existing data and make a list of

required fields.3. Arrange the data into tables. 4. Use sample data to troubleshoot for possible

problems such as reducing redundant data.5. Identify primary keys and specify foreign

keys used to relate tables. 6. Determine table relationships and revise the

table design as necessary.