Software Development Unit 2 Databases What is a database? A collection of data organised in a manner...

35
Software Development Unit 2 Databases

Transcript of Software Development Unit 2 Databases What is a database? A collection of data organised in a manner...

Page 1: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

Software Development Unit 2

Databases

Page 2: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

What is a database?

• A collection of data organised in a manner that allows access, retrieval and use of that data.

• Data is a collection of unprocessed items, which can include text, numbers, images, audio and video.

• Information is processed data; it is organised, meaningful and useful. Information can be in the form of audio, images and video.

Page 3: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

• Computers process data in a database into information.

• Database software – Database Management System (DBMS) - users create a computerised database that allows them to • add, modify and delete data in a database; • sort and retrieve data from the database; and • create forms and reports from the data in the

database.

• Databases allow instant access to data and information.

Page 4: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

• Most organisations realise that data is one of their more valuable assets, because data is used to generate information.

• To make sure that data is accessible, organisations must manage and protect its data. It is vital that the data stored in database software has integrity and is kept secure.

Page 5: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

• Data Integrity

• For a computer to produce correct information, the data that is entered into a database must have integrity – data integrity identifies the quality of the data.

• Data integrity is important because computers and people use information to make decisions and take actions.

Page 6: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

• Qualities of Valuable Information:

• For information to have value, it should be:• Accurate – error free • Verifiable – can be proven as correct or incorrect• Timely – has an age limit suited to its use • Organised – arranged to suit the needs and

requirements of the decision maker• Accessible – available when the decision maker

needs it • Useful – has meaning to the person who receives

it• Cost-effective – should give more value than it

costs to produce.

Page 7: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

The 3 main functions of a database are:

1. Data definition2. Data manipulation3. Data control

Page 8: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

1. Data Definition

An electronic database allows you to define the data including its:

• Data Type• Format• Storage requirements• Maintenance of Data Integrity

Page 9: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

2. Data Manipulation

Allows you to:

• Manipulate data efficiently• Record and retrieve data easily• Search and sort data for particular

purposes• Produce effective and timely reports• Update or add new data at any time

Page 10: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

3. Data Control

Allows you to

• Control user access to the data

• Query the database for specific information

• Sort and search faster and more accurately

Page 11: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

Database Management System

A DBMS is the program that creates the database and can manipulate the data within it.• They have no data in them. • Are used to create the structure that will

contain the data. • Allows users to create a database to suit

their particular purposes.

Page 12: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

Parts Of A Database

• Databases are made up of RECORDS.

• A record is the information about one particular person or thing. A record is a group of related fields.

• Each record has a similar structure but contains different data.

Page 13: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

• Every record is made up of a number of FIELDS.

• A field is a ‘container’ for a particular item of data.

• The same field on different records contains the same kind of data.

• Data is entered into each field of a record.

Page 14: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

Example:

• Coordinators at PEGS use a database that contains information about every student -DeltaLink.

• All the information about any one student is a record.

• Within each record there would be separate fields for the student’s first name, surname, address, phone number, photograph, etc.

Page 15: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

A database defines each field by a number of characteristics such as field size and data type.

• Field size defines the maximum number of characters a field can contain. Eg the Surname field contains 15 characters and so has a field size of 15.

• Data type specifies the kind of data a field can contain and how the field is used.

Page 16: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

• Common data types are:

• Text – letters, numbers or special characters.• Numeric – numbers only.• AutoNumber – automatically assigned unique

number.• Currency – dollar and cent amounts.• Date – month, day, year.• Memo – long text entries.• Yes/No (Boolean) – only Yes or No (True/False).• Hyperlink – e-mail address or Web address that

links to a Web page on the Internet or a Document on a network

• Object – photo, audio, video or other documents.

Page 17: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

Relational Databases

• Early database programs were called ‘flat-file’ databases because all data was stored in one central table.

• These days most commercial database packages store and handle data using a Relational Database Management System (RDBMS).

Page 18: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

• A relational database is a database that stores data in tables that consist of rows and columns. Each row has a primary key and each column (field) has a unique name.

• A relational database stores data as well as data relationships. A relationship is a link within the data. Relationships are set up between tables within a relational database. To do this, the tables must have a common column (field).

Page 19: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

• The common column (field) is often linked by a unique ID number that is assigned to each record.

• Relational databases allow for the efficient sharing of information between different users.

Page 20: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

• Tables in a relational database can be linked in a variety of ways (relationships):

1. A one-to-one relationship means that for each record in the first table, there is exactly one record in the second table.

Page 21: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

Example:

• Each patient has one medical record and each particular medical record relates to only one person.

Page 22: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

2. The most common relationship is a one-to-many relationship.

• This means that only one record in the first table can be related to many other records in the second table BUT any record in the second table only relates to one record in the first table.

Page 23: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

Example

• One student can take out many books from the library but any one book can only be taken out by one student at a time.

Page 24: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

3. A many-to-many relationship means that for each record in the first table, many records are required in the second table AND for each record in the second table, many records are required in the first table.

Page 25: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

• Example

• Each student will study many subjects and each subject will be studied by many students.

INFO TECH MATHS

SCIENCE

Page 26: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

Database Features

Storing• Large amounts of data can be stored for

later use or modification. It is generally stored on hard disk and backed up to prevent loss

Page 27: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

Validation• All database management systems allow for

electronic validation.

• It involves checking, electronically or non-electronically, the integrity of data to ensure that the input data is accurate, relevant and complete.

Page 28: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

Sorting• Data may be sorted alphabetically,

numerically, chronologically, or in descending or ascending order.

• A number of different fields can be sorted simultaneously in priority order.

Page 29: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

Searching• Allows records to be found according to certain

criteria

• Search criteria are established which use a field, a comparison operator eg >, <, =, etc and comparative data.

Page 30: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

Reporting• By the process of searching, sorting and

calculating, data is manipulated into meaningful information. This information must be communicated usually in the form of a hard copy report.

• Reports include a title, a date and meaningful column headings.

Page 31: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

Data Entry Screens• Also called forms, act as the interface between

the user and the database and allow data to be entered, edited and displayed.

• Are linked to the individual primary table and new records are therefore added to the existing data.

Page 32: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

Data Privacy & Security

• Privacy is a major concern for those involved with databases and their use.

• Large organisations use databases to store confidential information about their clients.

• Data is not indestructible.

Page 33: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

• Data can be (by human error, equipment failure problems with the software or by a catastrophe eg fire or flood):

• lost• corrupted and• damaged or destroyed

• It can also be • stolen or • illegally copied.

Page 34: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

• For these reasons data security measures are essential. These measures include:

1. Backing up the data on a regular basis – making a copy of the entire database.

- Data can be backed up daily, weekly, monthly or continuously.

2. Attempting to eliminate factors that cause accidental losses.

Page 35: Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.

3. Preventing unauthorised access to data which can result in it being stolen, misused or corrupted eg • By using passwords to restrict

access.• By allowing different access

privileges for data for different users. This involves establishing who can enter data, modify existing data, delete unwanted data, and view data.