ICT Lecture 07
ICT Lecture 07
• Database
– A collection of related data stored in a manner that
enables information to be retrieved as needed
• Database Management System (DBMS)
– Used to create, maintain, and access databases
– Database engine
• The part of the program that actually stores and
retrieves data
– Microsoft Access, OpenOffice Base, Corel Paradox,
Oracle
Database, etc.
2
Outline
• Database
• What is a Database
• Advantages & Disadvantages of the DBMS Approach
• Data Concepts & Characteristics
• Data Definition
• Data Hierarchy
• Entities
• Entity Relationships
• Data Integrity, Security & Privacy
• Centralized vs. Distributed Database Systems
3
What Is a Database?
4
What Is a Database?
5
What is a Database?
– Primary Key
• Field that uniquely identifies the records in a table
• Field in a table that is used to relate that table to other
tables
– Database Administrators
• Responsible for managing the databases within an
organization
– Users
• Individuals who enter data, update data, and retrieve
information from the database
8
What Is a Database?
9
What Is a Database?
11
Data Concepts and
Characteristics
• Data Hierarchy
– Fields/columns
• Hold single pieces of data
– Records/rows
• Groups of related fields
– Tables
• Collection of related records
– Database
• Contains a group of related tables
12
Data Concepts and
Characteristics
• Entities and Entity Relationships
– Entity
• A person, object, or event of importance to the
organization
• Entities that the organization wants to store data about
typically becomes a database table
– Attributes
• Characteristics of an entity
• Typically become fields in the entity’s database table
– Relationship
• An association between two or more entities
13
Data Concepts and
Characteristics
– One to One (1:1) Entity Relationships
• One entity is related to only one other entity of a particular
type
• Not a common type of relationship
– One to Many (O:M) Entity Relationship
• Most common type of relationship
• One entity can be related to more
than one other entity
– A supplier can supply more than one product to a
company
– Many to Many (M:M) Entity Relationships
• One entity can be related to more than one other entity, and
those entities can be related to multiple entities of the same
type as the original entity
14
Data Concepts and
Characteristics
• Data Definition
– The process of describing the properties of data to be
included in a database table
– During data definition, each field is assigned:
• Name (must be unique within the table)
• Data type (such as Text, Number, Currency,
Date/Time)
• Description (optional description of the field)
• Properties (field size, format of the field, allowable
range, if field is required, etc.)
– Finished specifications for a table become the table
structure
15
Data Concepts and
Characteristics
18
Data Integrity, Security, and
Privacy
– Database Locking
• Prevents two individuals from changing the same data
at the same time
19
Data Integrity, Security, and
Privacy
• Data Security
– Protects data against destruction and misuse
– Protects against unauthorized access to and unauthorized
use of a database
– Database activity monitoring programs can be used to
detect possible intrusions and risks
– Prevents data loss
– Should include strict backup and disaster-recovery
procedures (disaster-recovery plan)
– Should be used with both in-house and cloud
databases
20
Data Integrity, Security, and
Privacy
21
Data Integrity, Security, and
Privacy
– Data Privacy
• Growing concern because of the vast amounts of
personal data stored in databases today
• Many states require businesses to notify customers
when their personal data has been compromised
• Data breaches can be costly
– One estimate is $200 per breached record
22
How It Works Box
Column Databases
– Stores data by columns
instead of rows
– Improves performance
by minimizing the
time needed to read
the disk
– Used with data
warehouses and other
big data applications
28
The Relational Database Model
(RDBMS)
29
The Relational Database Model
(RDBMS)
• Creating a Relational Database
– Creating the Tables
• Each table is created using the table structure
developed during the database design process
– In Access, can use Design view or Datasheet view
– Entering and Editing Data
• Existing data can be migrated to the new database
• New data can be added via a form or Datasheet view
– In either case, the same data is being manipulated
30
Database Models
32
The Relational Database Model
(RDBMS)
– Relating Tables
• Once all tables have been created, they can be related
to one another using their primary keys
33
The Relational Database Model
(RDBMS)
• Retrieving Information from a Relational Database
– Query
• A request to see information from a database that
matches specific criteria
• Every DBMS provides tools users can use to query the
database for information
• Can also write in structured query language (SQL)
• Must be designed to extract information as efficiently
as possible
• Poorly written queries can impact the overall
performance of the system
34
The Relational Database Model
(RDBMS)
36
The Relational Database Model
(RDBMS)
37
The Relational Database Model
(RDBMS)
• Maintaining a Relational Database
– Table structures can be modified when needed
– Other possible modifications:
• Adding new indexes to speed up queries
• Deleting obsolete data
• Upgrading database software, installing patches
• Repairing/restoring data that has become corrupt
• Continuing to evaluate and improve security
38
The Object-Oriented Database
Model
• The Object-Oriented Database Model
– Object-Oriented Database Management System
(OODBMS)
• Database system in which multiple types of data are
stored as objects along with their related code
• Can contain virtually any type of data (video clip, text
with music, etc.) along with the methods to be used
with that data
• Objects can be retrieved using queries (object query
language or OQL)
• Objects can be reused in other applications to create
new applications quickly
39
Trend Box
41
Multidimensional Databases
(MDDB)
• Multidimensional Databases (MDDB)
– Designed to be used with data warehousing
– Often used in conjunction with Online Analytical
Processing (OLAP)
• MOLAP (Multidimensional OLAP)
– Data is stored in single structures called data cubes
• ROLAP (Relational OLAP)
– Data is stored in an existing relational database
using tables to store the summary information
• HOLAP (Hybrid OLAP)
– Combination of MOLAP and ROLAP
technologies
42
Cloud Databases
43
Technology and You Box
Cloud Databases
– Use growing rapidly
– Typically built using a cloud
provider (Windows Azure,
Amazon SimpleDB, or
Google Cloud SQL)
– Requires less in-house
hardware and maintenance
– Individuals can create via
Microsoft Access web apps
44
Cloud Databases
45
Cloud Databases
– Middleware
• Software used to connect two otherwise separate
applications, such as a Web server and a database
management system
• Commonly written as scripts
• Common languages include
– JavaScript
– VBScript
– CGI Scripts
– Active Server Pages (ASPs)
– PHP Scripts
46
Cloud Databases
47
Summary
• Database
• What is a Database
• Advantages & Disadvantages of the DBMS Approach
• Data Concepts & Characteristics
• Data Definition
• Data Hierarchy
• Entities
• Entity Relationships
• Data Integrity, Security & Privacy
• Centralized vs. Distributed Database Systems
48