企业信息化与信息管理研究
Download
Report
Transcript 企业信息化与信息管理研究
Part seven:
Modern IT Architecture
Desktop Systems (one computer)
PC Hardware
Software Systems
Distributed Systems (many computer)
Computer Networks and the Internet
Distributed application and Client/Server
The World Wide Web and e-commerce
Databases Technology
1. Database Concepts
2. Microsoft Access
3. Database Trends
FILE ORGANIZATION
A computer system organizes data in a hierarchy
that begins with bits, and proceeds to bytes, fields,
records, files, and database.
File
Record
Field
Byte
Record
Field
Byte
Byte
Bit
Field
Bit
Filed
Byte
Bit
Bit
FILE ORGANIZATION
BIT: Binary Digit (0,1;Y,N;On, Off)
BYTE: Combination of BITS which
represent a CHARACTER
FIELD: A logical grouping of characters into a
word, a group of words, or a complete number.
RECORD: Collection of FIELDS which reflect a
TRANSACTION
FILE: A Collection of Similar RECORDS
DATABASE: An Organization’s Electronic Library
of FILES
FILE ORGANIZATION
A
record
For Example,
Filed: Student’s name;
Record:
Number
Name
Course
Date
Grade
9525012
Zhang
Yan
MIS
1998.9
A
Name
Course
Date
Grade
Zhang
Yan
9525018 Jeff Yu
MIS
1998.9
A
MIS
1998.9
A
9525027
…
He Hui
MIS
1998.9
B
…
…
…
…
•File:
Number
9525012
FILE ORGANIZATION : Another way of
thinking about database components——
ENTITY: Person, Place, Thing, Event about
Which Data Must be Kept ( a record
describes an entity )
ATTRIBUTE: Description of a Particular
ENTITY (corresponds to fields)
KEY FIELD: Field Used to Retrieve, Update,
Sort RECORD
*
FILE ORGANIZATION
Record
Key Field
Attribute
Key Field
FDU NO.
HKU NO.
NAME
SEX
98HM001
93835
Xie Mingqiang
M
58702331
98HM002
93840
Yu Bing
F
65110968
98hm003
93841
Wang Pei
F
58711001
-23306
63568504
98HM004
93842
Ge Ruijin
M
56938860
56873143
98HM005
93843
Wang Xintao
M
58611828
65352394
98HM006
93844
Fu Qiang
F
58666060
-6007
58836304
File
TEL(O)
TEL(H)
KEY FIELD
Field in Each Record
Uniquely Identifies THIS Record
For RETRIEVAL
UPDATING
SORTING
*
Accessing Records from Computer
Files:Sequential vs. Direct or random
fileData
organization
SEQUENTIAL:
records must be retrieved
in the same physical sequence in which they are
stored. (Magnetic tape )
DIRECT: Data can be accessed without regard
to physical sequence. (Disk)
*
Direct file
organization
Sequential file
organization
Problems Arising from
the File Organization
Data Redundancy: The same piece of
information could be duplicated in several
files.
Data Inconsistency:
Data Isolation: Data files are likely to be
organized differently, stored in different
formats, and often physically inaccessible to
other applications.
data integrity problem: It is difficult to place
data integrity constraints across multiple data
files.
Application and Data Independence: In the file
environment, the applications and their
associated data files are dependent on each
other.
Poor security: is difficult to enforce in the file
environment.
Lack of data sharing & availability
Problems Arising from the File
Organization
Data Redundancy;
Data Inconsistency;
Data Isolation, data integrity problem;
Application and Data Independence;
Security, data sharing problem.
These problems led to the
development of DATABASE
DATABASE
A Database is an organized logical grouping
of related files.
In a Database, data are stored & managed in
a convenient form, and integrated and related
so that one set of software programs
provides access to all the data.
DATABASE MANAGEMENT SYSTEM
(DBMS)
Software to create & maintain DATA enables
business applications to extract data
independent of specific computer programs.
registrar
Class programs
Class file
accounting
Accounts programs
Class file
athletics
Sports programs
Class file
Computer based files of this type cause problems such as redundancy, inconsistency, and data isolation.
registrar
accounting
Class programs
Accounts programs
DBMS
Database
Class file
Accounts file
Sports file
athletics
Sports programs
DBMS provides access
to all data in the
database
COMPONENTS OF DBMS:
DATA DEFINITION LANGUAGE:
DATA MANIPULATION LANGUAGE:
Defines Data Elements in Database
Manipulates Data for Applications
DATA DICTIONARY:
Formal Definitions of all Variables in Database;
Controls Variety of Database Contents
*
TWO VIEWS OF DATA
PHYSICAL VIEW: WHERE IS DATA PHYSICALLY?
DRIVE, DISK, SURFACE, TRACK, SECTOR (BLOCK),
RECORD
TAPE, BLOCK, RECORD NUMBER (KEY)
LOGICAL VIEW: WHAT DATA IS NEEDED BY
APPLICATION?
SUCCESSION OF FACTS NEEDED BY
APPLICATION
NAME, TYPE, LENGTH OF FIELD
*
Database Structures
HIERARCHICAL DATABASE
ROOT
FIRST
CHILD
2nd
CHILD
Employer
Compensation
Ratings
Salary
Job
Assignments
Pension
Benefits
Insurance
Health
Type of RELATIONS
ONE-TO-ONE:
STUDENT
CLASS
ONE-TO-MANY:
STUDENT
A
MANY-TO-MANY:
ID
STUDENT
B
CLASS
1
STUDENT
A
STUDENT
C
CLASS
2
STUDENT
B
STUDENT
C
NETWORK DATA MODEL
Variation of Hierarchical Model
Useful for many-to-many relationships
CLASS
1
STUDENT
A
CLASS
2
STUDENT
B
STUDENT
C
RELATIONAL DATA MODEL
DATA IN TABLE FORMAT
RELATION: TABLE
Tuple: ROW (RECORD) IN TABLE
Field: COLUMN (ATTRIBUTE) IN TABLE
*
HOURS
RATE
TOTAL
ABLE
$ 40.50 $ 10.35 $ 419.18
BAXTER $ 38.00 $ 8.75 $ 332.50
CHEN
$ 42.70 $ 9.25 $ 394.98
DENVER $ 35.90 $ 9.50 $ 341.05
The Relational Database Model
The relational model is based on a simple concept
of tables in order to capitalize on characteristics of
rows and columns of data, which is consistent with
real-world business situations.
Tables are called relations, and the model is based on the
mathematical theory of sets and relations.
A row is called a tuple, and a column is called an attribute.
One of the greatest advantages of the relational
model is its conceptual simplicity and the ability to
link records in a way that is not predefined.
Example DB: Fortune 500
Companies
company
compname
sales
assets
netincome
empls
indcode
yr
allied
9115000
13271000
-279000
143800
37
85
boeing
9035000
7593000
292000
95700
37
82
...
industry codes
indcode
indname
42
pharmaceuticals
44
computers
...
The Relational Abstraction
Information is in tables
Columns define attributes
Also called fields or domains
Rows define records
Also called (base) relations
Also called tuples
Cells contain values
All cells in column have information of same type
e.g., integer, floating point, text, date
Operations on Tables
Add new rows (or sometimes columns)
Modify existing rows
Choose a subset of columns
Choose a subset of rows
Combine rows (e.g., sum values in a column)
Combine columns
Combine two tables (join)
No operations to combine individual cells
Unlike spreadsheet
Operating on Databases: SQL
Every abstraction needs an interface through which
users invoke abstract operations
graphical interface
language
Structured Query Language
Has all those operations
We'll focus only on queries
Query = question
Extract some data from one or more tables to answer a
particular question
Physical vs. Logical Data View
How can a single, unified database meet the differing
requirements of so many users?
Minimizes these problems by providing two “views”
of the database data:
The physical view deals with the actual, physical
arrangement and location of data in the direct access storage
devices (DASD).
The logical view, or user’s view, represents data in a
format that is meaningful to a user and to the software
programs that process that data.
2. Microsoft Access
Features:
Create/Modify
databases
Specify/Run queries
Design/Print reports
Design graphical user interfaces around databases
Forms for entering, viewing data
An Introduction
Microsoft Access GUI Building
A GUI is A Set of Forms
Forms
Used for
Entering data to tables
Displaying data from tables or queries in a nicer way
Each form is usually “bound” to a table or query
every “screenful” in the form displays the contents of one
record in that table or query
Forms contain Controls
Text boxes
Labels
Pictures
Buttons
Controls
Forms contain controls
Text labels
Text boxes
List boxes
Combo boxes
Option groups
Buttons
“Objects” created by other applications
Pictures
Word documents
Spreadsheets
Decorative lines and boxes
Every Control has a set of
Properties
Properties determine
where
the control gets its data from
how it is displayed
Usually properties are automatically set by
wizards
users
only need to occasionally fine-tune them
Creating Forms
Easy way: use an Access Wizard
Difficult way: manually add controls
Editing a form’s design
Select “Design View”
Modify controls
Modify properties
move them, resize them, delete them
right-click on a control to get to its property list
Add new controls
make Toolbox visible by selecting it from the “View” menu
drag and drop new controls from the Toolbox
set the properties of the new controls
Reports
Specify the structure of printed reports
Similar structure to forms
Every report is bound to a table or query
Reports have controls, where every control specifies how a
specific field of a record in the table/query will appear
Access provides wizards for easy creation of new
reports
Users typically only need to fine-tune them
Report Examples
Category Sales for 1995
New report, select Report Wizard
Base on query “Category Sales for 1995”
Select both fields, no grouping, sort by “Category Name”
Tabular Layout, Corporate Style
Store as “Category Sales for 1995”
Switch to “Design View”, add a text box in Report Footer to
show “Total Sales”
Access GUI Summary
2. A form displays
records from a
table or query
1. A GUI is a set of forms
3. A form has a
set of controls
4. A control displays
data from a field
or accepts user input
5. A control has
a set of properties
6. User interaction
with forms/controls
generates events
7. Macros can be
attached to form/control
event properties
Macros
Allow programmers to build functionality into
MS Access forms
Connect to forms and controls through events
Typical Uses of Macros
Open Forms from inside other Forms
Synchronize data in two open Forms
when
data changes in one form, corresponding
data also changes on the other form
Find a record which satisfies given properties
more
user-friendly that writing queries
Validating input data
Events
“Certain things that happen on the form or control”
Mouse clicks/double clicks
Form open/close
Control value changed
etc.
Controls have one property per event type
Determines what happens when event is triggered
Can be connected to a macro
Most Important Event Properties
On Click
On DoubleClick
After Update
triggered when we click/doubleclick on a control
triggered after we have changed the value of a control
On Current
Triggered every time a new record is displayed in a Form
Macro Structure
Each macro is a set of sequential actions
Each action has a set of parameters
Actions may (optionally) be conditional
Macros can be named and saved (just as
tables,queries, forms)
Macro Example
Conditions
Parameters
for
current
action
Actions
Comments
Explanation
of
parameters
3. Database Trends(1)
The evolution of Database System
Data
Simple data => Multimedia data, Knowledge
Model
Relational model => OO model
Object relational model
Databases Trends (2)
Application
Data organization
OLTP => OLAP
Database => Data warehouse, Data Marts
Query language
SQL => Deductive
Emerging Database Models
The most common database models are:
Multimedia database
Deductive databases
Object-oriented databases
Multimedia and hypermedia databases
Object-Oriented Database Model
Object-oriented (OO) databases store both data and
procedures acting on the data, as objects.
The OO database can be particularly helpful in
multimedia environments, such as in manufacturing
sites using CAD/CAM.
OO databases can be particularly useful in supporting
temporal and spatial(时空) dimensions.
Terminology in the OO model includes:
objects, attributes, classes, methods, and messages.
Hypermedia Database Model
The hypermedia database model stores
chunks of information in the form of nodes
connected by links established by the user.
The nodes can contain text, graphics, sound,
full-motion video, or executable computer
programs.
Users can branch to related information in any
kind of relationship.
Thanks for Your Attention