Download Creating a Database

Document related concepts

Big data wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Database wikipedia , lookup

Clusterpoint wikipedia , lookup

Relational model wikipedia , lookup

Database model wikipedia , lookup

Transcript
Basic database terminology
and concept
1
DATA REPRESENTATION


Analog vs. Digital
Digital

Two states


(1) on
(0) off
2
DATA REPRESENTATION


Binary number system
Combination of ones and zeroes
represent characters
3
Bit and Byte

Bit




Short for binary digit
Smallest element of data
Either zero or one
Byte


Group of eight bits, which operate as a
single unit
Represents one character or number
4
Representing Characters in
Bytes
5
Using Binary Code to
Calculate
6
Hierarchy of Data






Bit
Byte (Character)
Field
Record
File
Database
7
Database objects/tools




Table
Form
Query
Report
8
Table

A table is a grid of rows and columns
ROW
COLUMN
9
Field

A single trait or characteristic about a
subject of a table
NAMA
TARIKH
LAHIR
JANTINA
NO TEL
GAJI
10
Data type

Characteristic designate for an Access field








Text
Number
Currency
Date/time
Yes/No
Memo
OLE object
Hyperlink
11
Exercise








Salutation (Mr., Mrs., Ms.)
Date of birth
Home address
Whether a student is allergy to
medication
The words to describe type of allergy
Photo of a student
How many sibling in the house
Salary
12
Record


A group of traits about a particular item
Simply a row in a table!
NAMA
TARIKH
LAHIR
JANTINA
NO TEL
GAJI
…
…
13
Value

The actual data entered at the
intersection of a row and column
14
Primary keys




Key is a field that serves a specific
function within a table.
AutoNumber
Requirement for a relational database.
Means, in a field that is the primary
key, there can never be duplicate data
example
15
It’s about nothing: Null values and
Zero-Length strings

“Report that say something hasn’t happen
are always interesting to me because, as we
know, there are known knowns, there are
things we know we know. We also know
there are known unknowns; that is to say,
we know there are some things we do not
know. But there are also unknown
unknowns-the ones we don’t know we don’t
know”
At a press conference in 2003
Donald Rumsfeld
16
Secretary of Defense
(in the Bush Administration)
It’s about nothing: Null values and
Zero-Length strings

Example:
Student Name
Has Tel. No.?
Tel. No.
Jasman
Yes
018-1234567
Asmah
No
Does not exist
Syafiq
Yes
Exist, but we don’t
know it
Elangovan
Don’t know
Don’t know if there’s
one
17
Activity 2
18
Creating a Database
19
Three main steps



Determine the data you need
You describe the data
You enter the data into the database
20
Determine Data Needs

Two basic approaches can be used to
determine data needs:


A process-oriented approach
An enterprise modeling approach
21
A process-oriented approach

To define data needs in a processoriented approach:
1.
2.
3.
4.
5.
Define the problem
Identify necessary decisions
Describe information needs
Determine the necessary processing
Specify data needs
22
A process-oriented approach



Sometimes called the problemoriented approach
Because it begins with a problem
A problem can be good or bad
23
A process-oriented approach


Once problems are identified, the data
and processes dealing with problem
solutions can be determined
The strength is that it addresses
problems well
24
A process-oriented approach


Although the process-oriented approach
enables the data needs of each system to
be defined in a logical manner, its weakness
is the difficulty of linking the data from one
problem to another
IS cannot easily share data if they are
isolated from other IS dealing with other kind
of problems.
25
Enterprise modeling approach
26
Data Planning Process

Database development is a top-down
process

Develop an enterprise model that defines the
basic business process of the enterprise

Define the information needs of end users in
a business process

Identify the key data elements that are needed
to perform specific business activities
(entity relationship diagrams)
27
Enterprise modeling approach


The strength of this approach is that it
takes advantages of a broad view of
data resources
All areas are considered, and synergy
of data resources between areas can
be leveraged
28
Enterprise modeling approach
Strategic Planning for information resources
Create an
enterprise data
model
Storing that data
in the database
Determining all
of the org.’s data
needs
Create
database
29
Data Modeling Techniques


Modeling the org.’s data needs is
supported by techniques that describe
the data, how the data aggregates into
tables, and how tables relate to each
other.
A number of techniques: entityrelationship diagrams and class
diagrams
30
Entity-relationship diagrams

Are used to describe relationships
between conceptual collections of data
so that their related records can be
joined together
31
Class diagrams

Are used to describe both the data
relationship and the actions that
operate on the data in the relationships
32
Entity-relationship diagrams




ERDs
Deal with data in entities and the
relationships between entities
Entities – conceptual collections of
related data fields
Tables are the result of breaking
entities into smaller units that conform
to the rules for database structures
33
Entity-relationship diagrams


An entity may turn into table, but
frequently an entity is broken into
several tables
ERDs are a higher level
conceptualization of data than tables
34
Entity-relationship diagrams


Entities in ERDs will have names and
relationship links
ERD relationships will denote if a
record in one entity will relate to one or
more records in other entity
35
Entity-relationship diagrams

Let us assume that we need to
describe the data needed for a new IS:

IS Sekolah SAYA

3 separate data entities will exist:



…
…
…
36
37
1
M
1
M
38
To read the relationship:

One-to-many relationship - “one school
record may relate to many staff
records and one staff record may
relate to only one school record”
39
Many-to-many relationship
M
M
40
Many-to-many relationship

A single subject could have many staff,
and a single staff could be on many
subject
41
1
1
M
M
M
M
42
Class Diagrams
clsMataPel
clsSchool
Title
SchoolName
Ting
Adress
addMataPel
addSchool
deleteMataPel
deleteSchool
updateMataPel
updateSchool
1…*
1
1…*
1…*
1
1…*
clsStud
clsStaf
Name
Name
IC
Salary
StudAdd
HireDate
addStud
addStaf
deleteStud
deleteStaf
updateStud
updateStaf
ExamStud
43
Using the database

Forms, reports and queries are
common methods for accessing the
database held in database
management system
44
Database Structures

In all IS, data resources must be
organized and structured in some
logical manner so that they can be
accessed easily, processed efficiently,
retrieved quickly, and managed
effectively.
45
Database Structures

Common database structures…

Hierarchical

Network

Relational

Object-oriented

Multi-dimensional
46
Hierarchical Structure



Early DBMS structure
Records arranged in tree-like structure
Relationships are one-to-many
47
Network Structure


Used in some mainframe DBMS packages
Many-to-many relationships
48
Relational Structure

Most widely used structure



Data elements are stored in tables
Row represents a record; column is a field
Can relate data in one file with data in another,
if both files share a common data element
49
Relational Operations

Select

Create a subset of records that meet a stated
criterion



Example: employees earning more than $30,000
Join

Combine two or more tables temporarily

Looks like one big table
Project

Create a subset of columns in a table
50
Multidimensional Structure

Variation of relational model

Uses multidimensional structures to
organize data

Data elements are viewed as being in
cubes

Popular for analytical databases that
support Online Analytical Processing
(OLAP)
51
Multidimensional Model
52
Object-Oriented Structure


An object consists of

Data values describing the attributes of an entity

Operations that can be performed on the data
Encapsulation


Combine data and operations
Inheritance

New objects can be created by replicating some
or all of the characteristics of parent objects
53
Object-Oriented Structure
Source: Adapted from Ivar Jacobsen, Maria Ericsson, and Ageneta Jacobsen, The Object Advantage: Business Process
Reengineering with Object Technology (New York: ACM Press, 1995), p. 65.
Copyright @ 1995, Association for Computing Machinery. By permission.
54
Object-Oriented Structure

Used in object-oriented database
management systems (OODBMS)

Supports complex data types more
efficiently than relational databases


Examples: graphic images, video clips,
web pages
Example use for product design
55
Evaluation of Database
Structures



Hierarchical

Works for structured, routine transactions

Can’t handle many-to-many relationship
Network

More flexible than hierarchical

Unable to handle ad hoc requests
Relational

Easily responds to ad hoc requests

Easier to work with and maintain

Not as efficient/quick as hierarchical or network 56
Database Development

Database Administrator (DBA)

In charge of enterprise database development

Improves the integrity and security of
organizational databases

Uses Data Definition Language (DDL) to
develop and specify data contents, relationships,
and structure

Stores these specifications in a data dictionary
or a metadata repository
57
Data Dictionary

A data dictionary



Contains data about data (metadata)
Relies on specialized software component to
manage a database of data definitions
It contains information on..




The names and descriptions of all types of data
records and their interrelationships
Requirements for end users’ access and use of
application programs
Database maintenance
58
Security

Based on database structure above,
describe the characteristics of the IS or
the organization which hold the IS.
Use the following table for discussion:
59
System types
Simple
Complex
Has few components, and the relationship
or interaction between elements is
uncomplicated and straightforward
Has many elements that are highly related
and interconnected
Open
Closed
Interact with its environment
Has no interaction with the environment
Stable
Dynamic
Undergoes very little change over time
Undergoes rapid and constant change over
time
Adaptive
Non-adaptive
Is able to change in response to changes
in the environment
Is not able to change in response to
changes in the environment
Permanent
Temporary
Exists for a relatively long period of time
Exists for only relatively short period 60
of
time
Database Structures
Source: Management Information Systems by James
A. O'Brien and George Marakas. McGraw-Hill Higher
Education
61