Professional Documents
Culture Documents
Information: Context helps users Graphical displays turn data into useful
understand data information that managers can use for
decision making and interpretation
Definitions:
3
Definition: Metadata
Departmental/Divisional databases
Enterprise applications
Enterprise resource planning (ERP) systems
(transactional)
Data warehousing implementations Walmart’s operational system was
2.5 Petabytes (250 bytes) in 2008
And Apple’s Teradata system for
icloud is significantly larger
What do we do with a database?
Network Model:
Hierarchical Model:
Note that: the set of all customer and account records is organized in the form
of a rooted tree, where the root of the tree is a dummy node.
A hierarchical database is a collection of such rooted trees, and hence forms a forest.
History of databases
Codd’s contribution was revolutionary:
1. He separated the data from the
physical information storage, and
2. He described a framework for
storing and retrieving data using
simple rows and tables
1. Program-Data Dependence
All programs maintain metadata for each file they use
Changes in the data file means changes in the program that is used to access it
Difficult to locate all the programs that access this file
Error prone process
19
Disadvantages of File Processing:
2. Duplication of Data
Different systems/programs have separate copies of the same data
Different departments of the same company are not always synchronized
Waste of storage space
Increased effort to maintain all the data
No reliable metadata: for example the same field may have different name,
datatype or length in different files
20
Disadvantages of File Processing:
21
Disadvantages of File Processing:
22
Disadvantages of File Processing:
23
Why Databases?
24
Solution: The Database Approach
What it requires?
A Database Management System (DBMS)
Database Management System
Order Filing
System
4. Enforcement of standards
o One central management by the DBA
30
Elements of the Database Approach:
1. Data models
Graphical system capturing the nature and relationships of data
Enterprise Data Model–high-level entities and relationships for the
organization
Project Data Model–more detailed view, matching data structure in
database or data warehouse
Entity types:
CUSTOMER, ORDER, PRODUCT
Attributes:
The data you are interested in
capturing about an entity.
Example: Customer name or address
Data are recorded for many
customers. Each customer’s
information is an Entity Instance of
CUSTOMER entity type
Elements of the Database Approach:
3. Relationships
Between entities
Can be one-to-one (1:1), one-to-many (1:M) or many-to-many (M:N)
Many-to-many
relationship
Elements of the Database Approach:
4. Relational Databases
Entities are represented as Relations
Relationships are represented by means of common field values. They
are referred to as: foreign keys
Attribute
ENTITY
Instance
ENTITY (TYPE)
Relational Model:
Consists of:
• Data structure
• Tables (relations), rows, columns
• Data integrity
• Mechanisms for implementing business rules that maintain
integrity of manipulated data
• Data manipulation
• Powerful SQL operations for retrieving and modifying data
Relational Model – Data Structure:
In Flat Files everything is stored in one table:
In Relational Databases the data are separated into Relations, such that every table describes one and only one topic
(ENTITY): STUDENT data COURSE data TRAINER data
In Relational Databases the relationships between the data are maintained by Foreign keys:
In Relational Databases the data are separated into Relations, such that every table describes one and only one topic
(ENTITY):
In Relational Databases the relationships between the data are maintained by Foreign keys.
Attribute
ENTITY
Instance
ENTITY
Another Example:
EMPLOYEE(EmployeeID, EmployeeName, DeptName, Salary, CourseTitle, DateCompleted)
Example:
EMPLOYEE(EmployeeID, EmployeeName, DeptName, Salary, CourseTitle, DateCompleted)
oKeys are special fields that serve two main purposes and are
1. Primary keys
2. Foreign keys
oKeys can be simple (a single field) or composite (more than one field)
oKeys usually are used as indexes to speed up the response to user queries
Relational Model in more details:
Key Attributes
1. Primary keys
are unique identifiers of the relation
They guarantee that all rows are unique
Examples include employee numbers, social security numbers, etc
Can be simple or Composite
Relational Model in more details:
Key Attributes
2. Foreign keys
are identifiers that enable a dependent relation to refer to its parent relation
SAMPLE SCHEMA
Primary Key
Foreign Key (The Customer
that places an order must already exist
in the Customer table)
Consists of:
• Data structure
• Tables (relations), rows, columns
• Data integrity
• Mechanisms for implementing business rules that maintain
integrity of manipulated data
• Data manipulation
• Powerful SQL operations for retrieving and modifying data
Relational Model – Data Integrity:
Integrity constraints
• They are Rules
55
Relational Model:
Consists of:
• Data structure
• Tables (relations), rows, columns
• Data integrity
• Mechanisms for implementing business rules that maintain
integrity of manipulated data
• Data manipulation
• Powerful SQL operations for retrieving and modifying data
CREATING RELATIONAL TABLES
57
Is that all?
Components of Database Environment:
o Database: A Collection of data