0% found this document useful (0 votes)
15 views34 pages

Database Environment Presentation

The document outlines the ANSI-SPARC architecture for database systems, emphasizing a three-level approach: external, conceptual, and internal levels, which provide users with customized views while abstracting storage details. It discusses the importance of data independence, allowing changes at lower levels without affecting higher levels, and explains various database languages including DDL, DML, DCL, DQL, and TCL for managing database structures and operations. Additionally, it highlights the role of schemas and mappings in ensuring that user views align with the underlying data structure.

Uploaded by

emma.ogwayo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views34 pages

Database Environment Presentation

The document outlines the ANSI-SPARC architecture for database systems, emphasizing a three-level approach: external, conceptual, and internal levels, which provide users with customized views while abstracting storage details. It discusses the importance of data independence, allowing changes at lower levels without affecting higher levels, and explains various database languages including DDL, DML, DCL, DQL, and TCL for managing database structures and operations. Additionally, it highlights the role of schemas and mappings in ensuring that user views align with the underlying data structure.

Uploaded by

emma.ogwayo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

DATABASE

ARCHITECTURE
&
ENVIRONMENT
ANSI-SPARC ARCHITECTURE

A database is a shared resource, and each user may


require a different view of the data held in the database.
To achieve this, abstraction is applied to create an
architecture that can be used by the DBMS
A major aim of a database system is to provide users
with an abstract view of data, hiding certain details of
how data is stored and manipulated
ABSTRACTION
This is the simplification
mechanism to hide superfluous
details of a set of objects. It
allows one to concentrate on the
properties that are of interest to
the application
ANSI-SPARC ARCHITECTURE

The American National Standards Institute (ANSI) Standards


Planning and Requirements Committee (SPARC), ANSI/X3/SPARC,
produced this terminology and architecture in 1975 (ANSI, 1975).
ANSI-SPARC recognized the need for a three-level approach
with a system catalog.
1. External level- The way users perceive data
2. Conceptual level – Maps between external and internal levels
3. Internal level- The way DBMS and Operating system perceive
data (where data is stored)
THREE LEVEL ANSI-SPARC
ARCHITECTURE
There are several reasons why this separation
is important;
1. Customized View - each user would like a different view
2. Independent Interaction - Users should not have to deal directly
with physical database storage details
3. Ease in editing - The Database Administrator (DBA) should be
able to change the database storage structures without
affecting the users’ views
4. The internal structure of the database should be unaffected by
changes to the physical aspects of storage
5. The DBA should be able to change the conceptual structure of
the database without affecting all users.
THREE-LEVEL ARCHITECTURE
A. The External Level
The external level represents the user’s view of the database.
It describes the part of the database that is relevant to a
particular user.
For example, in a university, masters students may not view the
same units as undergraduate students.

Views may provide different representations of the same


data.
For example, some users might view dates in the form
(day/month/year) while others prefer (year/month/day).
THREE-LEVEL ARCHITECTURE
B. The Conceptual Level

The conceptual level describes what data is stored in the


database and the relationships among the data.
It is a complete view of the data requirements of the
organization that is independent of any storage
considerations.
The conceptual level supports each external view, in that any
data available to a user must be contained in, or derivable
from, the conceptual level.
THREE-LEVEL ARCHITECTURE
C. The Internal Level
The internal level covers the physical representation of the
database on the computer (and may be specified in some
programming language).
It describes how the data is stored in the database in terms
of particular data structures and file organizations.
The internal level is concerned with:
1. Allocating storage space for data and indexes.
2. Describing the forms that records will take when stored.
3. Record placement. Assembling records into files.
4. Data compression and encryption techniques.
THREE-LEVEL ARCHITECTURE
The Physical Level

The physical level may be managed by the operating system


under the direction of the DBMS.
The physical level below the DBMS consists of items only the
operating system knows, such as exactly how the sequencing
is implemented and whether the fields of internal records are
stored as contiguous bytes on the disk.
SCHEMAS, MAPPINGS AND INSTANCES
Schemas
The overall description of the database is called the
database schema.
The Name of a relation and the set of attributes for
a relation is called the schema for the relation.
Staff(Fname, Lname,DoB, Salary, BranchNo)
SCHEMAS, MAPPINGS AND INSTANCES
Schemas
They exist in three levels;
External schemas (also called subschemas) that correspond to
different views of the data.
At the conceptual level, we have the conceptual schema, which
describes all the entities, attributes, and relationships together
with integrity constraints.
At the lowest level of abstraction we have the internal schema,
which is a complete description of the internal model, containing
the definitions of stored records, the methods of representation,
the data fields, and the indexes and storage structures used.
SCHEMAS, MAPPINGS AND INSTANCES
Mapping
The DBMS must check that each external schema is
derivable from the conceptual schema.
It must use the information in the conceptual
schema to map between each external schema and
the internal schema.
SCHEMAS, MAPPINGS AND INSTANCES
Mapping
SCHEMAS, MAPPINGS AND INSTANCES
Mapping
The conceptual schema is related to the internal schema through a
conceptual/internal mapping.
This enables the DBMS to find the actual record or combination of
records in physical storage that constitute a logical record in the
conceptual schema, together with any constraints to be enforced on
the operations for that logical record.
It also allows any differences in entity names, attribute names,
attribute order, data types, and so on, to be resolved
SCHEMAS, MAPPINGS AND INSTANCES
Mapping
Each external schema is related to the conceptual schema by the
external/conceptual mapping.
This enables the DBMS to map names in the user’s view on to the
relevant part of the conceptual schema
DATA INDEPENDENCE
A major objective for the three-level architecture is to provide
data independence, which means that upper levels are
unaffected by changes to lower levels.
DATA INDEPENDENCE
Logical Data Independence
This refers to the immunity of the external schemas to changes in the
conceptual schema.
Changes to the conceptual schema, such as the addition or removal
of new entities, attributes, or relationships, should be possible
without having to change existing external schemas or having to
rewrite application programs.
DATA INDEPENDENCE
Physical Data Independence
This refers to the immunity of the conceptual schema to changes in the
internal schema.
Changes to the internal schema, such as using different file
organizations or storage structures, using different storage devices,
modifying indexes, or hashing algorithms, should be possible
without having to change the conceptual or external schemas
Questions???
DATABASE LANGUAGES

Previously, on Components of a DBMS


Data Definition Language (DDL)

A language that allows the DBA or user to describe and name the
entities, attributes, and relationships required for the application,
together with any associated integrity and security constraints.
The result of DDL statements will be a set of tables that are
stored in special file called data dictionary.
DDL is a set of Structured Query Language(SQL) commands
used to create, modify, and delete database structures but
not data.
Data Definition Language (DDL)
CREATE: This command is used to create the database or its
objects (like table, index, function, views, store procedure, and
triggers).
DROP: This command is used to delete objects from the database.
ALTER: This is used to alter the structure of the database.
TRUNCATE: This is used to remove all records from a table,
including all spaces allocated for the records are removed.
COMMENT: This is used to add comments to the data dictionary.
RENAME: This is used to rename an object existing in the
database.
Data Manipulation Language (DML)

A language that provides a set of operations to support the basic


data manipulation operations on the data held in the database.
Data manipulation operations usually include:
Insertion of new data into the database;
Modification of data stored in the database;
Retrieval of data contained in the database;
Deletion of data from the database
Data Manipulation Language (DML)

There are two types of DML;


1. Procedural DML
A language that allows the user to tell the system what data is
needed and exactly how to retrieve the data.
This means that the user must express all the data access
operations that are to be used by calling appropriate
procedures to obtain the information required.
Data Manipulation Language (DML)

There are two types of DML;


2.Non- procedural DML
A language that allows the user to state what data is needed rather
than how it is to be retrieved
The user specifies what data is required without specifying how
it is to be obtained. The DBMS translates a DML statement into
one or more procedures that manipulate the required sets of
records.
Data Manipulation Language (DML)
INSERT: command to add new data into a table.
UPDATE: command to change or update current/existing data to a
more recent value within the database.
DELETE: command to delete or delete the values or records/
data/ information of the current table in the database.
LOCK: It is used for Table control concurrency
Data Control language (DCL)

A language enables user to grant authorization and canceling


authorization of database objects.
DCL includes commands such as GRANT and REVOKE which
mainly deal with the rights, permissions, and other controls of
the database system.
Data Control Language (DCL)
GRANT: This command gives users access privileges to the
database.
REVOKE: This command withdraws the user’s access privileges
given by using the GRANT command.
Data Query Language (DQL)

DQL as is a component of SQL statement that allows getting data


from the database and imposing order upon IT.
It includes the SELECT statement.
The DQL command example is the SELECT.
SELECT: is used to retrieve data from the database.
Transaction Control language (TCL)

This SQL commands language enables user to control execution of


a transaction
A Transaction groups a set of tasks into a single execution unit.
Each transaction begins with a specific task and ends when all
the tasks in the group successfully complete. If any of the tasks
fail, the transaction fails
Transaction Control Language (TCL)
COMMIT: Commits a Transaction.
ROLLBACK: Rollbacks a transaction in case of any error occurs.
SAVEPOINT: Sets a save point within a transaction.
SET TRANSACTION: Specifies characteristics for the transaction.

You might also like