2. 2
The processing power of a database
allows it to manipulate the data it
houses, so it can:
Sort
Match
Link
Aggregate
Skip fields
Calculate
Database Manipulation
2
3. 3
Uses for database systems include:
They store data
They store special information used to manage the
data. This information is called metadata and it is
not shown to all the people looking at the data.
They can solve cases where many users want to
access (and possibly change) the same entries of
data.
They manage access rights (who is allowed to see
the data, who can change it)
When there are many users asking questions to the
database, the questions must be answered faster.
Certain attributes are more important than others,
Database Uses
3
5. 5
1. Self-describing nature of a database system
2. Insulation between program and data
3. Support for multiple views of data
4. Sharing of data and multiuser system
5. Control of data redundancy
6. Data sharing
7. Enforcement of integrity constraints
8. Restriction of unauthorized access
9. Data independence
10. Transaction processing
11. Provision for multiple views of data
12. Backup and recovery facilities
Characteristics of a Database
5
6. 6
A database system is referred to as self-
describing because it not only contains the
database itself, but also metadata which
defines and describes the data and
relationships between tables in the database.
1. Self-describing nature of a database system
6
Metadata means "data about data". Metadata is defined as the
data providing information about one or more aspects of the
data; it is used to summarize basic information about data which
can make tracking and working with specific data easier. Some
examples include:
Means of creation of the data
Purpose of the data
Time and date of creation
Creator or author of the data
File size
7. 7
In the file based system, the structure of the data
files is defined in the application programs so if a
user wants to change the structure of a file, all the
programs that access that file might need to be
changed as well.
On the other hand, in the database approach, the
data structure is stored in the system catalog not in
the programs. Therefore, one change is all that’s
needed.
2. Insulation between program and data
7
8. 8
A database supports multiple views of data.
A view is a subset of the database, which is defined
and dedicated for particular users of the system.
Multiple users in the system might have different
views of the system.
Each view might contain only the data of interest to
a user or group of users.
3. Support for multiple views of data
8
9. 9
Current database systems are designed for multiple
users. That is, they allow many users to access the
same database at the same time.
This access is achieved through features called
concurrency control strategies.
These strategies ensure that the data accessed are
always correct and that data integrity is maintained.
4. Sharing of data and multiuser system
9
10. 10
In the database approach, ideally, each data item is
stored in only one place in the database.
In some cases, data redundancy still exists to improve
system performance, but such redundancy is controlled
by application programming and kept to minimum by
introducing as little redundancy as possible when
designing the database.
The additional data can simply be a complete copy of
the actual data, or only select pieces of data that
allow detection of errors and reconstruction of lost or
damaged data up to a certain level.
5. Control of data redundancy
10
11. 11
The integration of all the data, for an organization, within
a database system has many advantages.
First, it allows for data sharing among employees and
others who have access to the system.
Second, it gives users the ability to generate more
information from a given amount of data than would be
possible without the integration.
6. Data sharing
11
12. 12
Database management systems must
provide the ability to define and enforce
certain constraints to ensure that users enter
valid information and maintain data integrity.
A database constraint is a restriction or rule
that dictates what can be entered or edited
in a table such as a postal code using a
certain format or adding a valid city in the
City field.
Database Constraint: (next
slide)
7.Enforcement of integrity constraints
12
13. 7.Enforcement of integrity constraints
13
A NOT NULL constraint prohibits a database value
from being null.
A unique constraint prohibits multiple rows from having
the same value in the same column or combination of
columns but allows some values to be null.
A primary key constraint combines
a NOT NULL constraint and a unique constraint in a
single declaration. That is, it prohibits multiple rows
from having the same value in the same column or
combination of columns and prohibits values from
being null.
A foreign key constraint requires values in one table to
Database
Constraint
14. 8. Restriction of unauthorized access
14
Not all users of a database system will have the same
accessing privileges.
For example, one user might have read- only access
(i.e., the ability to read a file but not make changes),
while another might have read and write privileges,
which is the ability to both read and modify a file.
For this reason, a database management system
should provide a security subsystem to create and
control different types of user accounts and restrict
unauthorized access.
15. 9. Data independence
15
Another advantage of a database management system
is how it allows for data independence.
In other words, the system data descriptions or data
describing data (metadata) are separated from the
application programs.
This is possible because changes to the data structure
are handled by the database management system and
are not embedded in the program itself.
16. 10. Transaction processing
16
A database management system must include
concurrency control subsystems.
This feature ensures that data remains consistent and
valid during transaction processing even if several
users update the same information.
17. 11. Provision for multiple views of data
17
By its very nature, a DBMS permits many users to have
access to its database either individually or
simultaneously.
It is not important for users to be aware of how and
where the data they access is stored
18. 12. Backup and recovery facilities
18
Backup and recovery are methods that allow you
to protect your data from loss.
The database system provides a separate process,
from that of a network backup, for backing up and
recovering data.
If a hard drive fails and the database stored on the
hard drive is not accessible, the only way to
recover the database is from a backup.
If a computer system fails in the middle of a
complex update process, the recovery subsystem
is responsible for making sure that the database is
restored to its original state.
21. 21
In the picture
there are the main
phases of
database design.
Database design
is connected with
application
design.
Phases of Database Design
21
22. 22
The requirements and the collection analysis phase
produce both
data requirements and
functional requirements
The data requirements are used as a source of
database design. The data requirements should be
specified in as detailed and complete form as
possible.
In parallel with specifying the data requirements, it is
useful to specify the known functional
requirements of the application.
These consist of user-defined operations that will be
applied to the database (retrievals and updates).
Phases of Database Design
22
24. 24
The three levels of data modeling,
conceptual data model,
logical data model, and
physical data model,
Types of Data Models
24
25. Data can be modeled at many levels, the most
common are the conceptual, logical and physical
level.
What is conceptual data modeling?
It is a very high-level representation of
organizational data.
The purpose is to show the basic building blocks
for the organization, i.e. the entities and rules
about their meaning and interrelationships.
Logical data modeling adds more detail to
conceptual modeling, but is still concerned only
with how the organization/business uses data.
Physical data modeling adds more detail, but is
especially concerned with the actual physical
Types of Data Models
26. A conceptual data model identifies the highest-level
relationships between the different entities.
Features of conceptual data model include:
Includes the important entities and the relationships
among them.
No attribute is specified.
No primary key is specified.
The figure is an example of
a conceptual data model.
Types of Data Models
Conceptual Data Model
27. A logical data model describes the data in as much
detail as possible, without regard to how they will be
physical implemented in the database.
Features of a logical data model include:
Includes all entities and relationships among them.
All attributes for each entity are specified.
The primary key for each entity is specified.
Foreign keys (keys identifying the relationship
between different entities) are specified.
Normalization occurs at this level.
Types of Data Models
Logical Data Model
28. The steps for designing the
logical data model are as
follows:
Specify primary keys for all
entities.
Find the relationships
between different entities.
Find all attributes for each
entity.
Resolve many-to-many
relationships.
Types of Data Models
Logical Data Model
29. Physical data model represents how the model will be built in
the database.
A physical database model shows all table structures, including
column name, column data type, column constraints, primary
key, foreign key, and relationships between tables.
Features of a physical data model include:
Specification all tables and columns.
Foreign keys are used to identify relationships between tables.
Denormalization may occur based on user requirements.
Physical considerations may cause the physical data model to
be quite different from the logical data model.
Physical data model will be different for different RDBMS.
For example, data type for a column may be different
Types of Data Models
Physical Data Model
30. The steps for physical data
model design are as follows:
Convert entities into tables.
Convert relationships into
foreign keys.
Convert attributes into
columns.
Modify the physical data
model based on physical
constraints requirements.
Types of Data Models
Physical Data Model
31. Types of Data Models
Feature
Conceptua
l
Logical Physical
Entity Names ✓ ✓
Entity
Relationships
✓ ✓
Attributes ✓
Primary Keys ✓ ✓
Foreign Keys ✓ ✓
Table Names ✓
Column Names ✓
Column Data
✓