24
Databases • Shortfalls of file management systems • Structure of a database • Database administration • Database Management system • Hierarchical Databases • Network Databases • Relational Databases • SQL

Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Embed Size (px)

Citation preview

Page 1: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Databases• Shortfalls of file management systems

• Structure of a database

• Database administration

• Database Management system

• Hierarchical Databases

• Network Databases

• Relational Databases

• SQL

Page 2: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Desirable Features in an Information System

• Integrity

• Data independence

• Controlled redundancy

• Security

• Privacy

Page 3: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Database Definition

• A computerised record-keeping system.• Used by a range of users who have different

requirements.– Minimal enquiries.– In-depth updating.– Restructuring.

• A well-implemented database will have data integrity, data independence, controlled redundancy, security and privacy, for all users.

Page 4: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Uses of a Database

• Generally used for on-line transaction processing (OLTP)

• Data warehouses are a hybrid of databases which are used for on-line analytical processing (OLAP)

Page 5: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Structure of a databaseExternalSchema

ConceptualSchema

InternalSchema

PhysicalSchema

Page 6: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

External Level

• Level visible to user

• Multiple views of the system– e.g. View an order - see limited product and

customer information

• Only the database Administrator may access the whole database at this level

Page 7: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

EXTERNAL SCHEMA

• Each external view is defined by means of an external schema

• Provides definitions of each external view.• Written in a Data Definition Language.• individual to the user or user group.• accessed through a 3GL, a query language or a

special purpose forms or menu-based language

Page 8: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Conceptual level

• CONCEPTUAL - represents the entire information content of the database

• Consists of multiple types of conceptual record. This level preserves the data independence of the database.

• CONCEPTUAL SCHEMA - defines each of the various types of conceptual record, in a conceptual Data Definition Language.

Page 9: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Internal level

• INTERNAL - a low-level representation of the entire database; it consists of multiple occurrences of multiple types of internal record. It is the stored record, inasmuch as it contains all but the device-specific information on the storage of the database.

• PHYSICAL - the physical device and block addresses for each of the records.

Page 10: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Mappings

• Each level maps onto adjoining levels• conceptual / internal mapping specifies how

conceptual records and fields are represented at the internal level

• Changes can be made in the internal level without affecting the conceptual level

• external / conceptual mapping defines the correspondence between an external view and the conceptual view

Page 11: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

DBMS - Database Management System

• software handling access to the database

• allows both the database administrator and all users the access to the database to which they are entitled

Page 12: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

How requests are processed

• User issues request (e.g. through SQL)• DBMS intercepts and analyses request• DBMS inspects user's external schema, external to

conceptual mapping, conceptual schema, conceptual to internal mapping and the storage structure definition.

• DBMS executes operations on stored database.

Page 13: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

DATABASE ADMINISTRATOR (DBA)

• Decide on the storage structure and access strategy

• Liase with the users

• Define security and integrity checks

• Define a backup and recovery strategy

• Monitor and respond to performance

Page 14: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Utilities used by the DBA

• Load routines• Dump/Restore routines• Reorganisation routines• Statistics routines• Analysis routines• Data dictionary (containing METADATA, which

gives data descriptions and mappings)

Page 15: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Database models

• Hierarchical

• Network

• Relational

• Object-oriented

• Hybrid

• Data Warehouses

Page 16: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Relational database

• Data is independent from programs and from other data

• Data is represented in TABLES rather than files. (one entity corresponds to 1 table)

• Column headings are described as DOMAINS. (i.e. attributes)

• Items of information as TUPLES or ROWS rather than records (i.e. occurrences of the entity)

Page 17: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Definitions• A RELATION is a collection of semantically related

information, usually containing a unique key. A

RELATION = a Table

• FOREIGN key - a key to a different relation that is used as

non-key data in this relation. (i.e. the enforcing field in the

relationship)

• SIMPLE key - uses one item from the row

• COMPOUND key - uses more than one item / attribute

• Unnormalized data - contains headings, footings, differing

number of occurrences for different fields.

Page 18: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Properties of a relation (TNF test)

• All row entries are non-divisible (atomic) - i.e. no such thing as arrays

• All entries in a particular column are drawn from the same set (i.e. no such thing as redefines)

Page 19: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Normalisation of data

• Collect all documents to be entered/produced

• Represent documents in unnormalized form

• Choose and identify key items, giving unnormalized data + keys

• Separate out repeating groups -> 1st Normal Form (1NF)

• Separate out part key dependencies -> 2nd Normal Form (2NF)

• Separate out inter-data and inter-key dependencies -> 3rd Normal Form (TNF)

• Apply TNF tests

• Optimise by combining relations with identical keys

• Apply TNF tests again

Page 20: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Relational database

• This is a database that is perceived by its users as a collection of tables. Each table can define an ENTITY

• Entities can be related through RELATIONSHIPS

• Relationships are implemented by use of foreign keys in tables

• Each column has a unique name within the table

• All rows are distinct (no two are the same)

• Row or column order is not significant

• Every relation must have a key

Page 21: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Implementation of desirable features

• Integrity– A field’s validation can be declared when the field is

declared. If this validation is used, then the integrity of the field remains intact.

– Entity integrity - No attribute participating in the primary key of a base relation is allowed to accept null values.

– Domain constraints - what are the possible valid values that can be used?

Page 22: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Referential integrity

– Through the propagation and use of foreign keys, no detail can be created where a master is needed, nor can a master be deleted without consent to the deletion of the details

Page 23: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Implementation of desirable features

• Data independence – The implementation of relational databases

causes the external and conceptual schema to be data independent. The internal schema and the physical level are data dependent.

• Controlled redundancy– The relational model reduces redundancy at the

conceptual level

Page 24: Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network

Tugas Individu

1. Kunjungi http://database.about.com/od/administration/a/databasefund.htm

2. Membuat ringkasan hasil kunjungan ke URL di atas.