0% found this document useful (0 votes)
171 views

Fundamentals of Database Management Systems (Cosc2041) : Chapter Two Database System Architecture

The document discusses the ANSI-SPARC architecture for database systems, which consists of three levels - the internal level dealing with physical storage, the conceptual level describing logical relationships, and the external level providing individual user views. It also covers topics like schemas and instances, data independence, database languages including DDL, DML, and DCL, and different data models like hierarchical, network, relational and object-oriented models.

Uploaded by

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

Fundamentals of Database Management Systems (Cosc2041) : Chapter Two Database System Architecture

The document discusses the ANSI-SPARC architecture for database systems, which consists of three levels - the internal level dealing with physical storage, the conceptual level describing logical relationships, and the external level providing individual user views. It also covers topics like schemas and instances, data independence, database languages including DDL, DML, and DCL, and different data models like hierarchical, network, relational and object-oriented models.

Uploaded by

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

Fundamentals of Database Management

Systems
(CoSc2041)

Chapter Two

Database System Architecture

Compiled by: Debritu A.


Contents
 Data models, Schemas, and Instances
 Over view of data models
 Architecture and Data Independence
 Database Language and Interface
 The Database System Environment
 Classification of DBMS

2
The ANSI-SPARC Architecture
 The following architecture is a standard designed by ANSI and is applicable to
most modern database systems.
 The architecture is composed of three levels:
a) Internal Level
b) Conceptual Level
c) External Level

3
The ANSI-SPARC Architecture…

a) Internal Level

 It is the one closest to physical storage.

That is, it is concerned with the way the data is physically stored.
It is the way the DBMS and the Operating system perceive the data.
It is concerned with how fields are represented, what physical
sequence the stored records are in, …
It deals with assembly and similar language commands.

4
The ANSI-SPARC Architecture…
b) Conceptual/Logical level
It is the community view of the database as seen by the DBA.
This is the next-higher level of abstraction next to internal level that
describes what data are stored in the database, and what relationships
exist among those data.
It includes Entity-Relationship modeling, security and integrity
constraints.
Although implementation of the simple structure at the logical level
may involve complex physical-level structures, the user of the logical
level does not need to be aware of this complexity.
The logical level of abstraction is used by database administrators, who
must decide what information should be kept in the database.
5
The ANSI-SPARC Architecture…
c) External/View level
The highest level of abstraction describes only some part of the
entire database.
It is concerned with how individual users view the database.
Despite the use of simpler structures at the logical level, some
complexity remains.
Because of the large size of the database, many users of the database
system will not be concerned with all this information.
 Instead, such users need to access only a part of the database. So that
their interaction with the system is simplified and the view level of
abstraction is defined.
The system provides many views for the same database.

6
The ANSI-SPARC Architecture…
For Example

7
Schemas and Instances
Schema
Is the overall description of the database, include explanation of the
database constraints that should hold on the database.
The three level of schema according their abstraction: entity describes
 External schema: at the external level to describe the various
user views.
 Conceptual schema: at the conceptual level to describe the
structure and constraints for the whole database for a community
of users. Uses a conceptual or an implementation data model.
 Internal schema: at the internal level to describe physical storage
structures and access paths.

8
Schemas and Instances…
Instances
 is the collection of data in the database at a particular point of
time.
 Also called State or Snap Shot or Extension of the database
 State of database is changed any time we add, delete or update an item.
 Since Instance is actual data of database at some point in time, changes
rapidly.

Mappings
 The DBMS is responsible for mapping between the 3 types of schema.
The conceptual schema is related to the internal schema through a Conceptual/Internal mapping.
Each External schema is related to the conceptual schema by the External/Conceptual mapping

9
Schemas and Instances…
 The contents of the external, conceptual and internal levels The
purpose of the external/conceptual and the conceptual/internal
mappings

10
Data Independence…
 The ability to modify a schema definition in one level
without affecting a schema definition in the next higher
level is called data independence.

 There are two levels of data independence:


 Physical data Independence
 Logical data independence

11
Data Independence
•Logical Data Independence:
Refers to immunity of external schemas to changes in
conceptual schema.
Conceptual schema changes e.g. addition/removal of entities should not

require changes to external schema or rewrites of application programs.


The capacity to change the conceptual schema without having to change

the external schemas and their application programs

12
Data Independence…
•Physical Data Independence
The ability to modify the physical schema without changing the
logical schema
The capacity to change the internal schema without having to change

the conceptual schema


Refers to immunity of conceptual schema to changes in the

internal schema
In general, the interfaces between the various levels and components

should be well defined so that changes in some parts do not seriously


influence others

13
Database Languages
 SQL languages fall into three broad categories:
 Data Definition Language (DDL),
 Data Manipulation Language (DML),
 Data Control Language (DCL) and
 Transaction Control Language (TCL)

14
Database Languages…
•Data Definition Language (DDL)
Allows DBA or user to describe and name entitles, attributes
and relationships required for the application.
Specification notation for defining the database schema

•Data Manipulation Language (DML)


Provides basic data manipulation operations on data held in the
database.
Language for accessing and manipulating the data organized by the

appropriate data model


DML also known as query language

15
Database Languages…
DML can be procedural or non-procedural
Procedural DML: user specifies what data is required and how

to get the data.


Non-Procedural DML: user specifies what data is required but not how

it is to be retrieved
SQL is the most widely used non-procedural language query

language
 Fourth Generation Language (4GL)
 Query Languages

 Forms Generators

 Report Generators

 Graphics Generators

 Application Generators

16
Database Languages . . .
Data Manipulation Language
Data Definition Language (DDL) (DML)
 Used to specify a database scheme  Data Manipulation Language, or
as a set of definitions expressed in Data Management Language)
a DDL statement.  A language for the manipulation
 DDL Statements: of data in a database.
 CREATE DATABASE  DML Statement:
 CREATE TABLE  INSERT INTO
 ALTER TABLE  UPDATE
 DROP DATABASE  SELECT
 DROP TABLE  RENAME
 TRUNCATE database/table  DELETE
 Etc.  Etc.

17
Database Languages . . .
Transaction Control Language
Data Control Language (DCL) (TCL)

 A Data Control Language (DCL)  TCL Statements


is a computer language and a  COMMIT
subset of SQL, used to control  ROLLBACK
access to data in a database
 SAVE POSITION
 DCL Statements:
 SET TRANSACTION
 GRANT
 REVOKE

18
Data Model

What is data model?


Data Model: a set of concepts to describe the structure of a

database, and certain constraints that the database should


obey.
A data model is a description of the way that data is stored

in a database. Data model helps to understand the relationship


between entities and to create the most effective structure to
hold data.

19
Data Model…
•Data Model is a collection of tools or concepts for describing
Data

Data relationships

Data semantics

Data constraints

• The main purpose of Data Model is to represent the data in an


understandable way.

20
Data Models
 What is a database models?
 It is a representation of real world objects and events and their associations.
 It’s a data model that describes in an abstract way how data is represented in an
information system or a database management system.
 The term model is ambiguous, since it can cover:
 How data is organized logically
 How data is organized, physically
 How data is accessed by the end user
 Database model can be divided into four:
 Hierarchical database model
 Network database model
 Relational database model
 Object-oriented database model

21
Hierarchical Database Model
 The simplest data model
 Record type is referred to as node or segment

 The top node is the root node

 Nodes are arranged in a hierarchical structure as sort of up


sidedown tree
 A parent node can have more than one child node

 A child node can only have one parent node

 The relationship between parent and child is one-


to- many

22
Hierarchical Database Model…
 Consists of an ordered set of trees in a parent child mode.
 Records are represented by rectangles.
 Allows a node to have only one parent.
 It has two data structure concepts:
 Records and PCR (parent child relationship).
 1-1 or 1-M link is allowed.
 Connection between child and its parent is called a Link.

23
Hierarchical Database Model…
 Advantages c
 The hierarchical model is a relatively simple
CSIT Department
one – which is its main strength.
 It is therefore particularly adapted to large,
simple databases.
 E.g. Family Tree Problem
Marc Sarma
 Disadvantage
 We must write a program
 Addition, deletion, and search operations are
very difficult.
 There is duplication of data. Binyam Zecharias Binyam Zecharias
 Records are ordered.
 Complex programming is required.

24
Network Database Model
 It is an extension of the hierarchical model
 Allows record types to have more that one parent unlike hierarchical

model
 A network data models sees records as set members

 Each set has an owner and one or more members

 Allow no many to many relationship between entities

 Like hierarchical model network model is a collection of physically

linked records.
 Allow member records to have more than one owner

25
Network Database Model…
 Advantages Cc
 Easy to show the connection of
items.
 Good for network type problem. CSIT Department

 Duplication of data is reduced as


compared to hierarchical model.
 Allows M-M relationships. Marc Sarma

  Disadvantages
 Complexity problem.
 Addition, deletion, search Binyam Zecharias
operations are difficult.
 Programming is required.

26
Relational Database Model
The main difference with the previous two models is that this
one gets rid (free) of physical pointers and of all the ensuing
limitations.

This makes the use of an RDBMS (Relational DBMS) much


simpler – a user or an application programmer only needs to
understand the logical structure of data, not how it is physically
stored.

 The relational data model, as its predecessors, has its own


associated terminology, which is inherited from the
mathematical theory on which it is based.

27
Relational Database Model…
The basic guiding principles in a relational data model are:
 Relation: a table with columns and rows.
 Attribute: it is a named column of a relation.
 Domain: is the set of allowable values for one or more attributes.
 Tuple: it is a row of a relation.
 Degree: is the number of attributes in a relation.
 Cardinality: is the number of row in a relation.
 Relational Database: is a collection of normalized relations with
distinct relation name.
All of this might seem a bit abstract – let’s look at the following concrete
example to make things clearer:

28
Relational Database Model…
C
Cc

29
Relational Database Model…
 The spreadsheet data above can be C
linked to the relational data model
concepts in the following way: Cc
 The entire spreadsheet above is a
relation, which we could call
“Student-Status”.

 (Naol, Mosisa, 1982, Warning),


and (Lelise, Gemechu, 1984,
Dean’s List) are the first two
tuples of this relation. fulfil

 “Name”, “Father-Name”, “Birth-


Year”, and “Academic-Status”
are the attributes of the relation.
30
Relational Database Model…
Thisrelation complies (fulfil) with the basic rules that govern the relational
data model:
 The order of the rows does not matter – the relation would be the same if
we re-ordered the records in alphabetical order of the name.
 The order of the columns does not matter – if “academic-status” came
before “birth-year”, the relation would still be the same.
 Each row is unique (we will come back to that later on).
 Values in one column are all of the same kind.

 Thedomains (or data types) for the values in the tuples must be atomic,
which means that:
 Allowed are: elementary data types such as text strings, integers,
dates, etc…
 Not allowed are: tuples, lists, sets, etc…

31
Relational Database Model…
Relations in an RDBMS are described using what is called a schema
– the name of the relation, a tuple with its attributes and their
respective data types.

The schema for our example above could be: Student-Status (Name
text string, Father-Name text string, Birth-Year integer, Academic-
Status text string)
Strengths & Weaknesses
 It is simple to understand.
It is highly flexible and easy to use search and access times are
relatively slow – slower, in any case, than in the previous two data
models.
32
Relational Database Model…
Properties of Relational Databases
A column or combination of columns that matches the primary key of
another table is called a foreign key. Used to cross-reference tables.

The referential integrity rule of the model states that, for every
foreign key value in a table there must be a corresponding primary key
value in another table in the database or it should be NULL.

All tables are logical entities

33
Relational Database Model…
Properties of Relational Databases
A table is either a BASE TABLES (Named Relations) or VIEWS
(Unnamed Relations)
Only Base Tables are physically stores

VIEWS are derived from BASE TABLES with SQL instructions like:

[SELECT .. FROM .. WHERE .. ORDER BY]

 Is the collection of tables o Each entity in one table


 Attributes are fields (columns) in table

34
Relational Database Model…
Properties of Relational Databases
Order of rows and columns is immaterial
Entries with repeating groups are said to be un- normalized

Entries are single-valued

Each column (field or attribute) has a distinct name

•All values in a column represent the same attribute and have


the same data format

35
Building Blocks of the Relational Data Model

The building blocks of the relational data model are:


Entities: real world physical or logical object

Attributes:properties used to describe each


Entity or real world object.
Relationship: the association between Entities

Constraints: rules that should be obeyed


while manipulating the data.

36
Object Database Model
A data model is a logic organization of the real world objects (entities),
constraints on them, and the relationships among objects.
A core object-oriented data model consists of the following basic
object-oriented concepts:
 Object and object identifier: Any real world entity is uniformly modeled as an
object

 Attributes and methods: every object has a state and a behavior (the set of
methods - program code - which operate on the state of the object). The state and
behavior encapsulated in an object are accessed or invoked from outside the object
only through explicit message passing.

37
Thank You!
Question?

38

You might also like