Anda di halaman 1dari 17

10/24/2018

Syllabus
 Concepts of database systems
 Database systems environment
 The Database Management System (DBMS)
Database 2 – C309 

The Relational Data Model
Database Design Process

3MISE 
Entity – Relational Modeling
Conceptual Database Design
 Logical Database Design for Relational
Model
 Physical Database Design for Relational
Database

Syllabus
 Data Normalization
 Database Languages INTRODUCTION
 Structured Query Language (SQL)
 Advanced SQL Foundations of Business
 Query-BY-Example (QBE) Intelligence:
 Database Application using MS-Access Databases and
 Database Security Information Management
• Database on the Web (PHP)

1
10/24/2018

The Data Hierarchy


Data Representation
data hierarchy starts
with the bit, which
represents either a 0 or
a 1. • ASCII
Bits can be grouped to (American
form a byte to represent Standard Code
one character,
number, or symbol. for
Bytes can be grouped to Information
form a field Interchange) is
Related fields can be
the most
grouped to form a
record. Related records widely used
can be collected to form coding
a file scheme to
Related files can be
organized into a
represent data
database.

Storage File organization concepts


• Capacity is the number of bytes a storage Computer system uses hierarchies
medium can hold • Field: Group of characters
• Record: Group of related fields
• File: Group of records of same type
• Database: Group of related files
-----------------------------------------------------------
Record: Describes an entity
Entity: Person, place, thing on which we store
information
Attribute: Each characteristic, or quality,
describing entity (E.g. Attributes Date or Grade
belong to entity COURSE)
7

2
10/24/2018

Database System Environment Problems with the traditional file processing (files
maintained separately by different departments)

• Data redundancy and inconsistency


• Data redundancy:
Presence of duplicate data in multiple files
• Data inconsistency:
Same attribute has different values
• Program-data dependence:
• When changes in program requires changes to data
accessed by program
• Lack of flexibility
• Poor security
• Lack of data sharing and availability

Database vs. File Systems File-based Processing

11

3
10/24/2018

Each functional area in


a corporation to
Traditional File Processing
Database Management System (DBMS)
develop specialized
applications and files.

Each application
requires a unique
data file that is
likely to be a
subset of the
master file.
These subsets of
the master file
lead to data
redundancy and
inconsistency,
processing
inflexibility, and
wasted storage
resources.

The Database Approach to Data Management


Database management system (DBMS) – special software
used to create, access, control, and manage a database.
Database: • The core of the DBMS is its database engine.
• A data definition language (DDL) is used to physically
• Collection of data organized to serve many define tables, fields, and structural relationships.
applications by centralizing data and controlling • A data manipulation language (DML) is used to create,
redundant data read, update, and delete records in database and navigate
between records.
• Database – a collection of interrelated files
Database management system:
• Interfaces between application programs and physical
data files
• Separates logical and physical views of data
• Solves problems of traditional file environment
• Controls redundancy
• Eliminated inconsistency
• Uncouples programs and data
• Enables central management and security
14-16

4
10/24/2018

Typical DBMS Architecture A Simplified Data base System Environment Illustrating


Concepts and Terminology
Systems Analysts Application End
and Programmers Users
Database Designers

Transaction Processing PC DBMS and/or


(TP) Monitor Query tools

DBMS
Data Definition Proprietary Language Data Manipulation
Language (DDL) and Tools Language (DML)

DATABASE ENGINE

USER 1-18
METADATA
DATA

The Database Approach to Data Management


The Database Design and Implementation
Human Resources Database with Multiple Views
A single human Process
resources Main phases of the overall database design and
database provides
many different
implementation process:
views of data, 1. Requirements collection and analysis
depending on the
information 2. Conceptual database design
requirements of
the user. 3. Choice of a DBMS
Illustrated here are 4. Data model mapping (also called logical
two possible database design)
views, one of
interest to a 5. Physical database design
benefits specialist
and one of interest 6. Database system implementation and tuning
to a member of the
company’s payroll
department.

5
10/24/2018

Data models and Database - Data base Design Data Modeling Using the Entity-Relationship Model
A Data Model:
A type of data abstraction that can be used to provide a conceptual
representation of data.
Data base design has three levels (models):
A) High Level Data Model (External or Conceptual Schema):
A concise description of users’ data requirement and detailed
description of data types , relationships and constraints using the Simplified
concepts provided by the model (entities, attributes and relationships) Description
B) Implementation Data Model: of the Data
Base Design
Actual representation of database using a commercial DBMS
Process
(relational, network or hierarchical) – a data model mapping is
needed to transform from high model into implementation model
C) Physical Data Model (Internal Schema):
Describes the physical storage structure of the database

Types of DBMS
3- Object-Oriented DBMS (OODBMS)
Hierarchical and Network DBMS: Older • Stores data and procedures as objects
systems
• Capable of managing graphics,
1- Hierarchical DBMS: Models one-to- multimedia, Java applets
many relationships
• Relatively slow compared with
2- Network DBMS: Models many-to-many relational DBMS for processing large
relationships numbers of transactions
• Both less flexible than relational DBMS 4- Hybrid object-relational DBMS:
and do not support ad hoc, natural
language Provide capabilities of both OODBMS
and relational DBMS

6
10/24/2018

The Database Approach to Data Management Hierarchical Database Model


5- Relational DBMS  Logically represented by an upside down tree
• Represent data as two-dimensional tables  Each parent can have many children
called relations or files  Each child has only one parent
• Each table contains data on entity and attributes

Table: Grid of columns and rows


• Rows (tuples): Records for different entities
• Fields (columns): Represents attribute for entity
• Key field: Field used to uniquely identify each
record
• Primary key: Field in table used for key fields
• Foreign key: Primary key used in second table
as look-up field to identify records from original
table

Network Database Model ER Model Concepts


 Each record can have multiple parents
There are three main tools to build an ER Model of
 Composed of sets
Database System:
 Each set has owner record and member record
• Entity
 Member may have several owners
• Attributes
• Relationships
2.1 Entity
A thing in Real World with an independent existence
It has two forms:
• Physical Existence (a person, car, house or an
Employee)
• Conceptual Existence (a company, job, department
or a project)

7
10/24/2018

Attribute and Attribute Types Three points of view for Attribute Types:
Simple versus Composite:
An Attribute is a particular property for an Entity • Simple Attribute: an Attribute that is not divisible into
Following figure shows two Entities and values of more basic components (Basic or Atomic Attribute) –
ID or Sex of a Person
their Attributes
• Composite Attribute: an Attribute that can be divided
into more basic components (Simple Attributes) – A
person’s Name or Address (Name = Fname, Mname
and Lname)

1-30

Relational Database Tables


Single valued versus multi-valued Attribute:
• Single valued Attribute: an Attribute that has
a single value for a particular entity – name,
birthdate
• Multi-valued Attribute: an Attribute that has a
set of values for a particular entity – College
degree or Hobby for a person

Stored versus Derived Attribute:


• Stored Attribute: an Attribute that can not be
derived – birth date
• Derived Attribute: an Attribute that can be
derived or calculated from a stored one – age
can be derived from birth date

8
10/24/2018

The Database Approach to Data Management The Three Basic Operations of a Relational DBMS

Operations of a Relational DBMS:


Three basic operations used to develop useful sets of data
SELECT:
Creates subset of data of all records that meet stated
criteria
JOIN:
Combines relational tables to provide user with more
information than available in individual tables
PROJECT:
Creates subset of columns in table, creating tables with
only the information specified
The select, project, and join operations enable data from two
different tables to be combined and only selected attributes
to be displayed.

EXAMPLE OF AN SQL QUERY The Database Approach to Data Management


Capabilities of Database Management Systems
Data definition capability:
Specifies structure of database content, used to
create tables and define characteristics of fields
Data dictionary: Automated or manual file storing
definitions of data elements and their characteristics
Data manipulation language:
Illustrated here are the SQL statements for a Used to add, change, delete, retrieve data from
query to select suppliers for parts 137 or 150. database
They produce a list with the same results as • Structured Query Language (SQL)
Figure 6-5. • Microsoft Access user tools for generation SQL
Also: Many DBMS have report generation capabilities for
creating polished reports (Crystal Reports)

9
10/24/2018

MICROSOFT ACCESS DATA DICTIONARY FEATURES AN ACCESS QUERY

Microsoft Access has a rudimentary data dictionary capability that displays


information about the size, format, and other characteristics of each field in a Illustrated here is how the query in Figure 6-7 would be constructed
database. Displayed here is the information maintained in the SUPPLIER table. The
small key icon to the left of Supplier_Number indicates that it is a key field.
using Microsoft Access query building tools. It shows the tables, fields,
and selection criteria used for the query.

Sample Data Dictionary Report The Database Approach to Data Management


The sample data Designing Databases
dictionary report • Conceptual & logical design: abstract model from
for a human business perspective
resources
• Physical design: How database is arranged on direct-
database
access storage devices
provides:
• The size of the Design process identifies:
data element, • Relationships among data elements, redundant
• Which database elements
programs and • Most efficient way to group data elements to meet
reports use it, business requirements, needs of application programs
• Which group in
the organization Normalization
is the owner • Streamlining complex groupings of data to minimize
responsible for redundant data elements and awkward many-to-
maintaining it. many relationships

10
10/24/2018

The Database Approach to Data Management The Database Approach to Data Management

An Un-normalized Relation for Order Normalized Tables Created from Order

An un-normalized relation contains repeating


groups. For example, there can be many parts and
suppliers for each order. There is only a one-to-
one correspondence between Order_Number and After normalization, the original relation ORDER has
Order_Date. been broken down into four smaller relations. The
relation ORDER is left with only two attributes and
the relation LINE_ITEM has a combined, or
concatenated, key consisting of Order_Number and
Part_Number.

The Database Approach to Data Management The Database Approach to Data Management
An Entity-Relationship Diagram Entity-relationship diagram
• Used by database designers to document the data
model
• Illustrates relationships between entities
Distributing databases: Storing database in more than
This diagram shows the relationships between the
one place
entities ORDER, LINE_ITEM, PART, and SUPPLIER
that might be used to model the previous database • Reduced vulnerability, increased responsiveness
• May depart from standard definitions, pose security
problems
• Partitioned: Separate locations store different parts
of database
• Replicated: Central database duplicated in entirety
at different locations

11
10/24/2018

The Database Approach to Data Management The Entity Relationship Model of the Company Database
Distributed Databases

There are alternative ways of distributing a database. The central database


can be partitioned (a) so that each remote processor has the necessary data
to serve its own local needs. The central database also can be replicated (b)
at all remote locations. 1-46

The Implementation Model of the Company Database

12
10/24/2018

Using Databases to Improve Business Performance and Decision Making

Big data
• Massive sets of unstructured/semi-structured data from
Web traffic, social media, sensors, and so on
• Petabytes, exabytes of data
• Volumes too great for typical DBMS
• Can reveal more patterns and anomalies
Business intelligence infrastructure
– Today includes an array of tools for separate systems,
and big data
Contemporary tools:
– Data warehouses
– Data marts
– Hadoop
– In-memory computing
– Analytical platforms

Using Databases to Improve Business Performance and Decision Making COMPONENTS OF A DATA WAREHOUSE
A contemporary business intelligence infrastructure features capabilities and tools to
Data warehouse: manage and analyze large quantities and different types of data from multiple sources.
Easy-to-use query and reporting tools for casual business users and more sophisticated
– Stores current and historical data from many core analytical toolsets for power users are included.
operational transaction systems
– Consolidates and standardizes information for use across
enterprise, but data cannot be altered
– Provides analysis and reporting tools

Data marts:
– Subset of data warehouse
– Summarized or focused portion of data for use by specific
population of users
– Typically focuses on single subject or line of business

13
10/24/2018

Using Databases to Improve Business Performance and Decision Making Using Databases to Improve Business Performance and Decision Making
Components of a Data Warehouse
Hadoop
– Enables distributed parallel processing of big data
across inexpensive computers
– Key services
• Hadoop Distributed File System (HDFS): data storage
• MapReduce: breaks data into clusters for work
• Hbase: NoSQL database
– Used by Facebook, Yahoo, NextBio

The data warehouse extracts current and historical data from multiple
operational systems inside the organization. These data are combined with
data from external sources and reorganized into a central database
designed for management reporting and analysis. The information directory
provides users with information about the data available in the warehouse.

Using Databases to Improve Business Performance and Decision Making Using Databases to Improve Business Performance and Decision Making

In-memory computing Analytical tools: Relationships, patterns, trends


– Used in big data analysis – Tools for consolidating, analyzing, and providing access
to vast amounts of data to help users make better
– Use computers main memory (RAM) for data storage business decisions
to avoid delays in retrieving data from disk storage
• Multidimensional data analysis (OLAP)
– Can reduce hours/days of processing to seconds
• Data mining
– Requires optimized hardware
• Text mining
Analytic platforms • Web mining
– High-speed platforms using both relational and non-
relational tools optimized for large datasets

14
10/24/2018

Using Databases to Improve Business Performance and Decision Making Using Databases to Improve Business Performance and Decision Making

Multidimensional Data Model


Online analytical processing (OLAP) The view that is
showing is product
– Supports multidimensional data analysis versus region. If
• Viewing data using multiple dimensions you rotate the cube
90 degrees, the
• Each aspect of information (product, pricing, face that will show
cost, region, time period) is different is product versus
dimension actual and
projected sales. If
• Example: How many washers sold in East in you rotate the cube
June compared with other regions? 90 degrees again,
– OLAP enables rapid, online answers to ad hoc (for you will see region
versus actual and
this _ solution for a specific problem _ not projected sales.
generalizable) queries Other views are
possible.

Using Databases to Improve Business Performance and Decision Making Using Databases to Improve Business Performance and Decision Making

Data mining: Data mining:


– Finds hidden patterns, relationships in datasets • More discovery driven than OLAP
• Example: customer buying patterns • The patterns and rules are used to guide
– Infers rules to predict future behavior decision making and forecast the effect of
– Types of information obtainable from data mining: those decisions
• Popularly used to provide detailed analyses of
• Associations: Occurrences linked to single event
patterns in customer data for one-to-one
• Sequences: Events linked over time marketing campaigns or to identify profitable
• Classification: Recognizes patterns that describe group to customers.
which item belongs
• Clustering: Similar to classification when no groups have
been defined; finds groupings within data
• Forecasting: Uses series of existing values to forecast what
other values will be

15
10/24/2018

Using Databases to Improve Business Performance and Decision Making Using Databases to Improve Business Performance and Decision Making

Predictive analysis Text mining


• Uses data mining techniques, historical data, and – Extracts key elements from large unstructured data
assumptions about future conditions to predict sets
outcomes of events • Stored e-mails
• E.g. Probability a customer will respond to an offer or • Call center transcripts
purchase a specific product. • Legal cases
Data mining seen as challenge to individual privacy • Patent descriptions
• Used to combine information from many diverse • Service reports, and so on
sources to create detailed “data image” about each of
– Sentiment analysis software
us—income, driving habits, hobbies, families, and
political interests • Mines e-mails, blogs, social media to detect
opinions

Using Databases to Improve Business Performance and Decision Making Using Databases to Improve Business Performance and Decision Making

Web mining Databases and the Web


– Discovery and analysis of useful patterns and • Many companies use Web to make some internal
information from Web databases available to customers or partners
– Understand customer behavior • Typical configuration includes:
– Evaluate effectiveness of Web site, and so on • Web server
– Web content mining • Application server/middleware/CGI scripts
• Mines content of Web pages • Database server (hosting DBM)
– Web structure mining • Advantages of using Web for database access:
• Ease of use of browser software
• Analyzes links to and from Web page
• Web interface requires few or no changes to database
– Web usage mining
• Inexpensive to add Web interface to system
• Mines user interaction data recorded by Web server

16
10/24/2018

Using Databases to Improve Business Performance and Decision Making Using Databases to Improve Business Performance and Decision Making

Linking Internal Databases to the Web


Business Intelligence:
• Tools for consolidating, analyzing, and providing
access to vast amounts of data to help users make
better business decisions
• E.g. Harrah’s Entertainment analyzes customers to
develop gambling profiles and identify most profitable
customers
• Principle tools include:
• Software for database query and reporting
• Online analytical processing (OLAP)
• Data mining
Users access an organization’s internal database through
the Web using their desktop PCs and Web browser
software.

Using Databases to Improve Business Performance and Decision Making

A series of Business Intelligence


analytical
tools works
with data
stored in
databases to
find patterns
and insights
for helping
managers and
employees
make better
decisions to
improve
organizational
performance.

17

Anda mungkin juga menyukai