CIS 321 Data Communications & Networking

Download Report

Transcript CIS 321 Data Communications & Networking

CIS 250
Advanced Computer Applications
Database Management Systems
Databases
Used to store electronic information
 Referred to as secondary storage


We will discuss
Uses for databases
 How information may be organized in
databases
 How it may be processed

University of South Alabama - CIS 250
2
Data Organization





Character – a single letter, number, or
character (ex: A)
Field – a set of related characters (ex: Last
Name)
Record – a set of related fields (ex: all
information on a specific drivers license)
Table – a collection of related records (ex: all
drivers licenses for Mobile County)
Database – a collection of related files (ex: all
drivers license files for the state of Alabama)
University of South Alabama - CIS 250
3
Key Fields
Key fields are used within each record
to specifically identify an individual
record
 Should be unique
 Example: driver’s license number

University of South Alabama - CIS 250
4
Processing of Data


Batch processing - data is collected
over a period of time (hours, days, or
weeks, etc.) and is processed all at
once
Real-time processing - data is
processed at the same time the
transaction occurs; more widely used
now due to direct access storage
(disks)
University of South Alabama - CIS 250
5
File Organization

3 main methods of file organization:



Sequential
Direct file storage
Index Sequential
University of South Alabama - CIS 250
6
Sequential File Storage

Sequentially - records are stored physically
one after another in a predetermined order,
determined by the key field; can be stored on
tapes.


Advantage - can be very efficient when all or large
portions of the records need to be accessed at the
same time
Disadvantage - can be much slower when looking
for a particular record since we must begin with the
1st record and check through every one in order
until we find it
University of South Alabama - CIS 250
7
Direct file storage

Direct file storage - records are stored on
a disk in a particular address that can be
determined by their key field; can be
stored on disk.
Adv - very efficient when finding a specific
record and does not require looking through
each one in order to access it
 Disadv - more storage space is required on
the disk, which may not be as good when
accessing large portions of the record.

University of South Alabama - CIS 250
8
Index sequential
Index sequential access - a compromise
between sequential and direct file
access;
 Records are stored in a file, in sequential
order; however, an index also exists.
The index lists the key to groups of
records and the corresponding disk
address for those records.
 Requires disks as storage devices.

University of South Alabama - CIS 250
9
Index sequential (cont)
Adv - faster than sequential, but not as
fast as direct file access for specific
records; when updating a large number
of records, it is faster than direct access
but slower than sequential access.
 Best used when large amounts of
records must be updated only
occasionally, but the user also desires
quick access to specific records.

University of South Alabama - CIS 250
10
Benefits of Databases




Data Sharing – information in one department can
be readily shared with other departments.
Security – users can be given passwords and/or
access only to the kind of information they need to
know while containing all of the information only
once in the database.
Data Redundancy – fewer files are necessary; the
data is stored only once and in one location. This
reduces the storage space needed.
Data Integrity – Changes made in the file will
update all occurrences of the information.
University of South Alabama - CIS 250
11
Database Management Systems

DBMS - special software that allows you to
create, modify, and gain access to a database.
 data dictionary - contains a description of the
structure of the data used in the database;
defines the field names, what type of data can
go into the field, the size of the field, and also
defines which field is the key field.
 query language - allows access to the
information in the database; most widely used
query language is SQL (structured query
language).
University of South Alabama - CIS 250
12
Database Organization

Most common types of database formats
are:
Hierarchical Database
 Network Database
 Relational Database
 Object Oriented Database

University of South Alabama - CIS 250
13
Hierarchical Databases

Structured in nodes (tree like structure)
 Each child node has one and only one parent
node (a parent may have more than one child
node). We refer to this as a 1-to-many
relationship.
 Progress top down to traverse fields. To find
information, you must start at the top with a
parent node and trace down the tree.
 Use pointers to connect parent node to child
nodes.
University of South Alabama - CIS 250
14
Hierarchical Databases


Advantages of Hierarchical Databases:
 Efficient and easy to create
Disadvantages of Hierarchical Databases:
 If a parent node is deleted, so are all child nodes
 Cannot add a child node without adding all parent
nodes first
 Low flexibility – paths and directories to information
must be specified in advance; very difficult to
change
 Difficult to maintain
University of South Alabama - CIS 250
15
Network Databases
Variation on the hierarchical database to
reduce data redundancy
 Child nodes can have more than one
parent (many-to-many relationship)
 Nodes are reached through pointers;
may provide more than one path to same
information

University of South Alabama - CIS 250
16
Network Databases

Advantages of Network Databases:
Efficient
 Faster than hierarchical
 Less data redundancy


Disadvantages of Network Databases:
Low flexibility
 More pointers; the number of pointers
increases rapidly, which makes it much
more complicated to maintain and operate.

University of South Alabama - CIS 250
17
Relational Databases
The most flexible – it is not hierarchical
in nature
 Uses tables made up of columns and
rows

Columns correspond to Fields
 Rows correspond to Records


Related tables can be linked together
through Common Data Elements (keys,
foreign keys)
University of South Alabama - CIS 250
18
Relational Databases


Advantages of Relational Databases:
 Simple to add, delete, and edit; there are no
pointers
 It can relate data in one field in one table to another
field in another table
 Flexible – ad hoc queries can combine data from
different sources
Disadvantages of Relational Databases:
 Slower – may require multiple access to the data
 Requires some data redundancy in order to be
more efficient - the same data must appear in
multiple tables to link the tables
 Must remember to change/update all tables
University of South Alabama - CIS 250
19
Object Oriented Databases


Handles unstructured data such as
photographs, graphics, audio, video, etc.
Keep track of objects – both data and the
action that can be taken on the object.
University of South Alabama - CIS 250
20
Types of Databases




Individual – collection of files primarily used by just
one person
Company/Shared – databases that can be used
by multiple users, shared through local area
networks
Distributed – data for the database is stored in
multiple locations with access through
communication networks
Proprietary – an enormous database developed to
cover particular subject areas; usually offers
access to people for a fee – databanks.
University of South Alabama - CIS 250
21
CIS 250
Advanced Computer Applications
Database Management Systems