Database Management

Download Report

Transcript Database Management

5
Database Management
Ch.14-A,B,C,D
FALL 2000
Rob Wolfe
1
5
What is data?
da-tum n [L, fr. neut. of datus]
1 pl. da-ta : something given or
admitted esp. as a basis for
reasoning or inference
2 pl. da-tums : something used as
a basis for calculating or
measuring
2
DIT 2006 - Wolfe
5
Managing Data
 Paper-based record-keeping approach
 Personal / Less official data
 Still viable
 Electronic record-keeping approaches
 File systems
 Database systems
3
DIT 2006 - Wolfe
5
File Systems
 A file system is a collection of electronic
data files that are specifically designed for
and around individual applications.
 Efficient
 Inflexible
 Important! - “Not every computerized
record-keeping system is a database
system.”
4
DIT 2006 - Wolfe
5
File Systems
DF
R
DF
DF
L
B
5
DIT 2006 - Wolfe
5
Database Systems
 A database system is a computerized
record-keeping system that maintains
information and makes it available to
multiple users upon demand. [Date]
 Requirements
 Data model
 DBA
 DBMS
6
DIT 2006 - Wolfe
5
Data Modeling
 Entity
 Attribute
 Value
 Instance
Student
ID:
1234567
Name:Jack Jones
Class: 2000
Sex: M
Addr: 123 Main Street ...
7
DIT 2006 - Wolfe
5
Data Modeling
...........
 Entity
 Attribute . . . . . . . . . . .
...........
 Value
 Instance . . . . . . . . . . .
 Table
 Field
 Data Item
 Record
ID:
1234567
Name:Jack Jones
Class: 2000
Sex: M
Addr: 123 Main Street ...
8
DIT 2006 - Wolfe
5
Data Modeling
...........
 Entity
 Attribute . . . . . . . . . . .
...........
 Value
 Instance . . . . . . . . . . .
 Table
 Field
 Data Item
 Record
9
DIT 2006 - Wolfe
5
Data Modeling
 Hierarchical Data Model
 Network Data Model
 Relational Data Model
 Object-oriented Data Model
Fields
Primary Key
Records
10
DIT 2006 - Wolfe
5
Database Management System
 A Database Management System (DBMS) is
a piece of software that defines the
database structure and performs data
manipulation to the records residing in a
database
 Selection of a DBMS depends on data model
and data management environment.
 Examples … Access, Oracle, Sybase, DB2,
Informix, SQL Server
11
DIT 2006 - Wolfe
5
Database Administrator
 A Database Administrator (DBA) is
responsible for …
 Data modeling & database establishment
 Maintenance of data dictionary
 Management and upgrade of DBMS
 User support & training
 Database system documentation
12
DIT 2006 - Wolfe
5
When it comes to database systems ...
 Remember these two keywords!
 Integration
 Sharing
 These two words make the difference
between database systems and file
systems!
13
DIT 2006 - Wolfe
5
Database Systems
DBMS
B
DB
DBA
R
L
14
DIT 2006 - Wolfe
5
Why Database Systems?
 Advantages over traditional (paper-based)
record-keeping systems
 Compact
 Speedy
 Less Drudgery
 Current
 Available
15
DIT 2006 - Wolfe
5
Why Database Systems?
 Advantages over file systems due to
integration and sharing through centralized
control
 Reduced Redundancy
 Data integrity (Rid inconsistency)
 Standards
 Security
 Better Communication
16
DIT 2006 - Wolfe
5
Can you tell them apart?
 Database
 Database Management System (DBMS)
 Database System
17
DIT 2006 - Wolfe
5
Can I call this a database system?
 Microsoft Access
 Personal Computer
 Single User
18
DIT 2006 - Wolfe
5
What is a “Data File”?
Possible definitions:
“A data file is any file that … ”
 Contains data
 Documents
 Spreadsheets
 Sounds, Graphics, Videos
 Not executable!
 Contains information in a uniform format
 ID, Name, Phone, etc.
 Examples: Inventory, Library Catalog
19
DIT 2006 - Wolfe
5
File, Records, Fields, and Data Items
20
DIT 2006 - Wolfe
5
Common Data Types
 Numeric
 Numbers
 Mathematical manipulation implied
 Real, Integers, etc.
 Character or String
 Alphanumeric
 Name, description, ID
 Date
 Logical (Yes or No)
 Memo
21
DIT 2006 - Wolfe
5
Data Modeling
 An effective data model helps …
 Enter, find, and manipulate data
 Understand relationships between entities
 Create efficient data structure
 Techniques
 Show Entities, Relationships, and Cardinality
 Entity-Relationship (E-R) Diagrams
22
DIT 2006 - Wolfe
5
Data Modeling
 Entities and Relationships
Employee
Belongs
to
Department
23
DIT 2006 - Wolfe
5
Data Modeling
Cardinality ... The number of occurrences
that can exist between two record types
 One-to-one
 One-to-many
 Many-to-many
Employee
S.S.N.
Employee
Employee
Phone No.
Certificate
24
DIT 2006 - Wolfe
5
Is it a good data model?
 Query1: Find ID numbers of students in
MGT 2006.
 Query2: Find Courses that Student 12000 is
taking.
 Insert: Add Student 32222, William Gates,
an MIS major.
 Delete: Student 13111 drops MGT 2006,
which is the only course she takes.
 Update: Student 31111 switches to MIS
major.
25
DIT 2006 - Wolfe
5
Data Models
 Hierarchical Data Model
 Network Data Model
 Relational Data Model
 Object-oriented Data Model
Course
Student
26
DIT 2006 - Wolfe
5
Hierarchical Data Models
Course
Instructor
Room
Time
MGT 2006
Barney
B214
MWF 06:00
Student ID
Name
Major
Grade
12000
13111
15000
Day, Ken
Smith, Doris
Jones, Mary
MIS
ACC
MKT
A
B
B
MKT 1000
25000
31111
LAW 4101Judy
12000
31111
Bond
B201
Brown, James
Dolk, Sean
B120
Day, Ken
Dolk, Sean
MWF 12:00
ACC
MKT
A
B
TTH 1:00
MIS
MKT
B
A
27
DIT 2006 - Wolfe
5
Data Models
 Hierarchical Data Model
 Network Data Model
 Relational Data Model
 Object-oriented Data Model
Course
Link
Nodes
Student
28
DIT 2006 - Wolfe
5
Network Data Model
A
MGT 2006
MKT 1000
Barney
Bond
B
12000
Day, Ken
MIS
B
13111
Smith, Doris
ACC
A
15000
Jones, Mary
MKT
25000
Brown, James
ACC
31111
Dolk, Sean
MKT
B
B
LAW 4101
Judy
A
Link
Nodes
29
DIT 2006 - Wolfe
5
Data Models
 Hierarchical Data Model
 Network Data Model
 Relational Data Model
 Object-oriented Data Model
Course
Instructor
Room
MGT 2006
MKT 1000
LAW 4101Judy
Barney
Bond
B214
MWF 06:00
B201
MWF 12:00
TTH 1:00
B120
Time
30
DIT 2006 - Wolfe
5
Relational Data Model
Course
Instructor
Room
MGT 2006
MKT 1000
LAW 4101Judy
Barney
Bond
B214
MWF 06:00
B201
MWF 12:00
TTH 1:00
B120
Time
Student ID
Name
Major
12000
13111
15000
25000
31111
Day, Ken
Smith, Doris
Jones, Mary
Brown, James
Dolk, Sean
MIS
ACC
MKT
ACC
MKT
Course
Student ID
Grade
MGT 2006
MGT 2006
MGT 2006
MKT 1000
MKT 1000
LAW 410112000
LAW 410131111
12000
13111
15000
25000
31111
A
B
B
A
B
B
A
31
DIT 2006 - Wolfe
5
Software for Data Management
 Custom Software (Programming Languages)
 File management Software
 DBMS
 Web-Enabled Software
32
DIT 2006 - Wolfe
5
Object-Oriented DBMS
33
DIT 2006 - Wolfe
5
Web-Enabled Tools
 Common Gateway Interface (CGI ) allows
you to pass requests from the Web browser
to the database and back again using
programs written in languages such as Perl,
C, and Visual Basic.
 Web application development tools provide
a way to link HTML pages to a database
without programming. (E.g., Cold Fusion)
34
DIT 2006 - Wolfe