databases and database management systems. slide 2databases and dbms definition a database is an...

25
Databases and Databases and Database Database Management Systems Management Systems

Post on 22-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Databases and Databases and Database Database

Management Management SystemsSystems

Databases and Databases and Database Database

Management Management SystemsSystems

Databases and DBMS Slide 2

Definition

• A database is an application package used for storage and retrieval of data

• A database is a structured collection of related data

Databases and DBMS Slide 3

Why Use a Database?

• All organisations need to keep records of transactions they perform with suppliers and customers

• Organisations need records of employees, orders, invoices etc

• The business needs to be able to find information quickly and easily as needed

Databases and DBMS Slide 4

Terminology

• Entity– This is the thing/object you are

recording information about.– Types of entities

• Person Employee• Country Customer• Product Invoice• Order Part

Databases and DBMS Slide 5

Attributes

• Attributes are the characteristics that describe the entities. For the entity Employee:– Name - Address– Age - Gender– Tel No - Soc Sec Number etc– Dept - Date Hired

Databases and DBMS Slide 6

Fields

• This is where we store the attributes– Name– Age– Address etc

• No two fields can have the same name

Databases and DBMS Slide 7

Record

• A record holds all the data relating to a single person or a single transaction etc

• A record is a collection of Fields• The number if Fields needed

depends on the subject

Databases and DBMS Slide 8

A File

• Is a collection of records• All the student records would

make up the Student File• All the employee’s records could

make up the Employee File

Databases and DBMS Slide 9

A Organisation Database

• Contains all the files within the organisation

• A College Database could contain the following files– Student File– Course File– Grant File– Personnel File– Student Applications File

Databases and DBMS Slide 10

Database Models

• Not all databases store data in the same way. This depends on the type of software used.

• Database Models are– Relational - Hierarchical– Network - Object Oriented

• For our course we are using Access which is a Relational Model

Databases and DBMS Slide 11

DBMS

• The Database Management System (DBMS) is the software that manages the database

• It is the user interface that allows the user to create, add, delete and generally manipulate the data in the database

Databases and DBMS Slide 12

COLLEGE DATABASE

Databases and DBMS Slide 13

COLLEGE DATABASE

Databases and DBMS Slide 14

COLLEGE DATABASE

Databases and DBMS Slide 15

Linking

• We need to repeat some fields so that we can LINK the tables

• The repeated fields allow us to link the information in one table to that in another

Databases and DBMS Slide 16

PRIMARY KEY

• A primary key is one that uniquely identifies a record

• Student ID is a number allocated to each student as there may be 2 students with the same name

Databases and DBMS Slide 17

Relationships

• If we want to link data from different tables we must define RELATIONSHIPS between the tables

• This involves linking the Primary Key field of one table with a field in a second table

Databases and DBMS Slide 18

Database Query

• When we want to extract information from a database this is called a ‘Query’

• The result is a screen display that shows the information you want which may have been extracted for one or more tables

Databases and DBMS Slide 19

Features of a DBMS• It allows us to create database files• It enables the user to update, delete,

add or change data in the database• It enables the user to link tables• It enables the user to query the

database• The user can produce reports on

screen or in printed form

Databases and DBMS Slide 20

Query “Co Mayo”

• If we query the Student database regarding which students come from Co Mayo the database will give us the following result

Databases and DBMS Slide 21

Advantages of Databases

• The DBMS makes the entry of data to the system is quick and easy

• Data is organised in a way that minimises data redundancy (re-entering of the same data over and over)

Databases and DBMS Slide 22

Advantages• A DBMS allows the organisation to

have a central store of information so anyone who needs access can get it

• A DBMS can keep data secure by using passwords etc and limiting access to the data

• Better access to data for decision-making

Databases and DBMS Slide 23

Advantages• Easy update and retrieval of data• Easy to create reports for

management• Reduced data redundancy• Data is shared throughout the

organisation• Better security of data• Better data integrity

Databases and DBMS Slide 24

Disadvantages

• Cost of the software• Complexity• Size – huge amounts of data• Backup procedures required• High impact of failure• Skilled personnel needed to

maintain a DBMS

Databases and DBMS Slide 25

Summary• A DBMS is a powerful piece of software

for managing data• Can store large quantities of data• Data is consistent throughout the

organisation when a DBMS is used (data integrity)

• It is easier to maintain data security• It is much easier to distribute

information throughout the organisation