21
Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

  • View
    219

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

Database Design ConceptsInfo 1408

Lecture 2

An Introduction to Data Storage

Page 2: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

Lecture 2- Data Storage

Objectives of lectureIntroduce the purposes of data processingExplain the terms of fields, records and filesExplain how these are organised in traditional data processing systemsIntroduce how Database offers a solution to some of the problems with traditional data processing systems

Page 3: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

Information System

Information systems process dataWhat is data?A definition

Often computerised but can be manual

Page 4: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

Typical activities of an Information System

Getting data into the system ( )Storing data ( )Sorting data ( )Finding data ( )Processing data into a usable data ( )Changing data ( )Checking data is correct and reasonable (Validation and verification)Calculation

Page 5: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

To be able to carryout these processes we need to organise our dataThe smallest unit of usable data is known as a field or

Page 6: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

Properties of fields

Each field will have A name A description A Size A type A value of a variable A range of acceptable values

Page 7: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

Example Date of Birth

Name- date of birthDescription- the date the person was bornSize- 10 characters (dd/mm/yyyy)Type- dateValue of a variable

This varies for each person but each person will have a value for date of birth which is stored in that field

Range- the date should be before today’s date

Page 8: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

Complete the following table

Name Student name

Address

Description

Size

Type

Range

Page 9: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

Records

Fields that describe an entity are combined to make a recordFor example Student name, student address and student telephone number all describe a student- they are combined in a student record to record facts about a studentEach individual student will have a record- made up of the same fields

Page 10: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

Records continued

When designing a record it is important to decide which fields are required to carryout all the processing requirements of the information systemA record can have fields (fields which must have a value)

And fields ( some instances may not have a value)

Eg all students must have a name and date of birth but not all of them will have a mobile phone number

Page 11: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

Files

Records which describe the same type of entity are grouped together into a fileFor example all the individual student records will be kept together in a file- this will usually have a name that describes what the records hold information about – in this case the student file seems an appropriate name

Page 12: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

An information system needs to store all of these files (on disc)This is no different to a filing cabinet we need to store the files in a way that makes it easy for us to find any information as easily as possible.

Page 13: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

Imagine using a filling cabinet to store student registration forms and all the forms have been placed in a filing cabinet and you need to know if a student called John has been registered properlyWe make it easy to find information by sorting all the records in a file in a particular order.

Page 14: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

File organisation- traditional

Serial in the order they were added to the fileSequential- in a specific order eg

Indexed sequential – In a specific order but with an index to help you locate something specific ( index is like a book index it tell you where to go exactly on the disc)Random access uses a key (or ) which tells you where to find the record.

Page 15: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

The problem with this approach is that you have to think how you want to access your information and choose a file organisation to do this. This is often called a system. As different users may want to do different things there may be situations where

Page 16: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

Different users have different versions of the same file

ExampleBank customer changes their addressThe customer has a record for their current account, savings

account, bank loan and the marketing file all of which record the customers address.

How can we be sure we have changed it on every file

Examples of junk mail etc show very often things don’t get changed on all files

Even worse what if you find yourself with two addresses for the same customer- which is correct ?

The other problem with this you have a lot of duplicate data and are therefore wasting a lot space and money maintaining it.

Page 17: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

Problems in doing new activities.For example recording e-mail addresses for

customers ( you didn’t before)As programmes will need to know how a

file is structured any change to the file means every programme which uses that file will need to be changed. This takes a great deal of time and costs a lot of money

Page 18: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

How do we reduce these problems

In recent years many companies have used Databases to remove these problems (and many others)A database provides a method of storage which enables all the users to share the data ( removes the and problems) in a way that allows the structure of the data to be changed relatively easily (for example add new fields)

Page 19: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

This means it is easier to use but it makes the design more difficult. It is important to design a database that meets everyone's needs

We will be learning how to identify all the data requirements of the different users and organise it in a way which allows everyone to share the same dataWe will identify the attributes required- (which is the database name for a field)Into tables ( which is the database name for a file)

Page 20: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

Summary

Information systems store data in files- In database system this known as a table.A file is made up of records which describe each instance of interest using the same fields.A database system calls a record a row, and a field is known as an attribute.Files are organised in a way that makes it easy for a user to find a specific record but this may not be suitable for all users.Databases give us a way of being able to find data easily and quickly.

Page 21: Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage

References

Databases Demystified by Andy Oppel