Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
27 views

Database chapter 2 lecture note

Chapter Two discusses database system concepts and architecture, emphasizing data abstraction through data models that describe database structure, relationships, and constraints. It covers various data models, including hierarchical, network, and relational models, detailing their advantages and disadvantages. Additionally, the chapter explains database schemas, states, data independence, DBMS architecture, database languages, interfaces, and classification criteria for DBMSs.

Uploaded by

Tesfalegn Yakob
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Database chapter 2 lecture note

Chapter Two discusses database system concepts and architecture, emphasizing data abstraction through data models that describe database structure, relationships, and constraints. It covers various data models, including hierarchical, network, and relational models, detailing their advantages and disadvantages. Additionally, the chapter explains database schemas, states, data independence, DBMS architecture, database languages, interfaces, and classification criteria for DBMSs.

Uploaded by

Tesfalegn Yakob
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

CHAPTER TWO: Database System Concepts and Architecture

Chapter Two
2. Database System Concepts and Architecture
One fundamental characteristic of the database approach is that it provides some level of data
abstraction by hiding details of data storage that are not needed by most database users.
❖ A data model-a collection of concepts that can be used to describe the structure of a
database-provides the necessary means to achieve this abstraction.
❖ It 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.
❖ It also set of concepts to describe the structure of a database, and certain constraints that
the database should obey.
Data Model is a collection of tools or concepts for describing
➢ Data
➢ Data relationships
➢ Data semantics
➢ Data constraints
Data Model Structure and Constraints:
o Data Model constructs define the database structure
o Data model constructs often include: data elements and their data types
(often called attributes); grouping of related elements into entities (also
called objects or records or tuples); and relationships among entities
o Constraints specify restrictions on the stored data; the data that satisfies
the constraints is called valid data
Data Model Operations:
o These operations are used for specifying database retrievals and updates
by referring to the constructs of the data model.
o Operations on the data model may include basic model operations (e.g.
generic insert, delete, update) and user-defined operations (e.g.
compute_student_gpa, update_inventory
The main purpose of Data Model is to represent the data in an understandable way. Categories of
data models include:
❖ Object-based
❖ Record-based
❖ Physical
Record-based Data Models
✓ Consist of a number of fixed format records.
✓ Each record type defines a fixed number of fields,
✓ Each field is typically of a fixed length.

FUNDAMENTALS OF DATABASE SYSTEMS 1


CHAPTER TWO: Database System Concepts and Architecture

 Hierarchical Data Model


 Network Data Model
 Relational Data Model
1. Hierarchical 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 upside down 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
• Relation is established by creating physical link between stored records (each is
stored with a predefined access path to other records)
• To add new record type or relationship, the database must be redefined and then
stored in a new form.

ADVANTAGES:
✓ Hierarchical Model is simple to construct and operate on
✓ Corresponds to a number of natural hierarchically organized domains - e.g.,
assemblies in manufacturing, personnel organization in companies
✓ Language is simple; uses constructs like GET, GET UNIQUE, GET NEXT, GET
NEXT WITHIN PARENT etc.

DISADVANTAGES:
❖ Navigational and procedural nature of processing
❖ Database is visualized as a linear arrangement of records
❖ Little scope for "query optimization"

2. Network Model

FUNDAMENTALS OF DATABASE SYSTEMS 2


CHAPTER TWO: Database System Concepts and Architecture

➢ Allows record types to have more than 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

ADVANTAGES:
 Network Model is able to model complex relationships and represents semantics of
add/delete on the relationships.
 Can handle most situations for modeling using record types and relationship types.
 Language is navigational; uses constructs like FIND, FIND member, FIND owner, FIND
NEXT within set, GET etc. Programmers can do optimal navigation through the
database.
DISADVANTAGES:
 Navigational and procedural nature of processing
 Database contains a complex array of pointers that thread through a set of records.
 Little scope for automated "query optimization”
3. Relational Data Model
➢ Developed by Dr. Edgar Frank Codd in 1970 (famous paper, 'A Relational Model
for Large Shared Data Banks')
➢ Terminologies originates from the branch of mathematics called set theory and
predicate logic and is based on the mathematica l concept called Relation
➢ Can define more flexible and complex relationship
➢ Viewed as a collection of tables called “Relations” equivalent to collection of
record types
➢ Relation: Two dimensional table
➢ Stores information or data in the form of tables rows and columns
➢ A row of the table is called tuple equivalent to record
➢ A column of a table is called attribute equivalent to fields
➢ Data value is the value of the Attribute
➢ Records are related by the data stored jointly in the fields of records in two tables
or files. The related tables contain information that creates the relation

FUNDAMENTALS OF DATABASE SYSTEMS 3


CHAPTER TWO: Database System Concepts and Architecture

➢ The tables seem to be independent but are related somehow.


➢ No physical consideration of the storage is required by the user
➢ Many tables are merged together to come up with a new virtual view of the
relationship

➢ The rows represent records (collections of information about separate items)


➢ The columns represent fields (particular attributes of a record)
➢ Conducts searches by using data in specified columns of one table to find additional data
in another table
➢ In conducting searches, a relational database matches information from a field in one
table with information in a corresponding field of another table to produce a third table
that combines requested data from both tables

2.1 Schemas, Instances, and States


❖ In any data model it is important to distinguish between the description of the database
and the database itself. The description of a database is called the database schema.
Or it describes how data is to be structured.
❖ A displayed schema is called a schema diagram.
❖ We call each object in the schema—such as STUDENT or COURSE—a schema
construct.
❖ A schema diagram displays only some aspects of a schema, such as the names of record
types and data items, and some types of constraints. Other aspects are not specified in the
schema diagram.
Instances
The data in the database at a particular moment in time is called a database state or snapshot.
✓ Also called State or Snap Shot or Extension of the database
✓ Refers to the actual data in the database at a specific point in time
✓ It is also called the current set of occurrences or instances in the database. In a given
database state, each schema construct has its own current set of instances; for example,
the STUDENT construct will contain the set of individual student entities (records) as its
instances.

FUNDAMENTALS OF DATABASE SYSTEMS 4


CHAPTER TWO: Database System Concepts and Architecture

State of database is changed any time we add, delete or update an item.


Valid state: the state that satisfies the structure and constraints specified in the schema and is
enforced by DBMS.
2.2 DBMS Architecture and Data Independence
➢ The goal of the three-schema architecture is to separate the user applications and the
physical database. In this architecture, schemas can be defined at the following three
levels:
1. The internal schema, which describes the physical storage structure of the database. The
internal schema uses a physical data model and describes the complete details of data storage
and access paths for the database.
2. The conceptual schema, which describes the structure of the whole database for a
community of users.
The conceptual schema hides the details of physical storage structures and concentrates on
describing entities, data types, relationships, user operations, and constraints. A high-level
data model or an implementation data model can be used at this level.
3. The external or view level includes a number of external schemas or user views. Each
external schema describes the part of the database that a particular user group is interested in
and hides the rest of the database from that user group. A high-level data model or an
implementation data model can be used at this level.

2.1.1 Data Independence


The three-schema architecture can be used to explain the concept of data
independence, which can be defined as the capacity to change the schema at one

FUNDAMENTALS OF DATABASE SYSTEMS 5


CHAPTER TWO: Database System Concepts and Architecture

level of a database system without having to change the schema at the next higher
level. We can define two types of data independence:
1. Logical data independence is the capacity to change the conceptual schema without
having to change external schemas or application programs.
• We may change the conceptual schema to expand the database (by adding a
record type or data item), or to reduce the database (by removing a record type or
data item).
• In the latter case, external schemas that refer only to the remaining data should
not be affected.
• Only the view definition and the mappings need be changed in a DBMS that
supports logical data independence. Application programs that reference the
external schema constructs must work as before, after the conceptual schema
undergoes a logical reorganization.
Changes to constraints can be applied also to the conceptual schema without affecting the
external schemas or application programs.
2. Physical data independence is the capacity to change the internal schema without having
to change the conceptual (or external) schemas.
➢ Changes to the internal schema may be needed because some physical files had to be
reorganized—for example, by creating additional access structures—to improve the
performance of retrieval or update. If the same data as before remains in the database,
we should not have to change the conceptual schema.

2.3 Database Languages and Interfaces


❖ Once the design of a database is completed and a DBMS is chosen to implement the
database, the first order of the day is to specify conceptual and internal schemas for
the database and any mappings between the two.
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
➢ Typical manipulations include retrieval, insertion, deletion, and modification of the
data.
➢ Procedural DML: user specifies what data is required and how to get the data.

FUNDAMENTALS OF DATABASE SYSTEMS 6


CHAPTER TWO: Database System Concepts and Architecture

➢ Non-Procedural DML: user specifies what data is required but not how it is to be
retrieved.
Data control language (DCL)
 Is a syntax similar to a computer programming language used to control access to data
stored in a database.
 In particular, it is a component of Structured query language (SQL).
 Examples of DCL commands include:
 GRANT: to allow specified users to perform specified tasks.
 REVOKE: to cancel previously granted or denied permissions.
 The operations for which privileges may be granted to or revoked from a user or role may
include: CONNECT, SELECT, INSERT, UPDATE, DELETE, EXECUTE, and USAGE.
 In the Oracle database, executing a DCL command issues an implicit commit.
 Hence you cannot roll back the command.

2.3.1 DBMS Interfaces


• It is a mediator that enables database users to interact with the database system.
• Interfaces are often graphical or at least partly graphical (GUI - graphical user interface)
constructed and offer tools which make the interaction with the database easier.
Database interfaces include:
➢ Stand-alone query language interfaces
– Example: Typing SQL queries directly through the DBMS
interactive SQL.
➢ Programmer interfaces for embedding DML in programming
languages:
SQL can be embedded into another language (host language) which might
be used to create a database application.
➢ Open database connectivity (ODBC): provides application programming
interfaces for c or C++.
➢ User-friendly interfaces (often Web-based)
➢ Forms-based, designed for naïve users

FUNDAMENTALS OF DATABASE SYSTEMS 7


CHAPTER TWO: Database System Concepts and Architecture

This interface consist of forms which are adapted to the user. He/She can fill in all of the
fields and make new entries to the database or only some of the fields to query the other
ones.
❖ Graphics-based (Point and Click, Drag and Drop etc.)

2.4 Classification of DBMSs


Several criteria are normally used to classify DBMSs.
The first is the data model on which the DBMS is based.
✓ The two types of data models used in many current commercial DBMSs are the
relational data model and the object data model. Many legacy applications still run
on database systems based on the hierarchical and network data models.
✓ The relational DBMSs are evolving continuously, and, in particular, have been
incorporating many of the concepts that were developed in object databases. This has
led to a new class of DBMSs that are being called object-relational DBMSs. We can
hence categorize DBMSs based on the data model: relational, object, object-
relational, hierarchical, network, and other.
The second criterion used to classify DBMSs is the number of users supported by the system.
✓ Single user systems support only one user at a time and are mostly used with personal
computers.
✓ Multiuser systems, which include the majority of DBMSs, support multiple users
concurrently.
A third criterion is the number of sites over which the database is distributed.
A DBMS is centralized if the data is stored at a single computer site. A centralized DBMS can
support multiple users, but the DBMS and the database themselves reside totally at a single
computer site.
A distributed DBMS (DDBMS) can have the actual database and DBMS software distributed
over many sites, connected by a computer network.
✓ Homogeneous DDBMSs use the same DBMS software at multiple sites. A recent
trend is to develop software to access several autonomous preexisting databases
stored under.
✓ Heterogeneous DBMSs. This leads to a federated DBMS (or multi database
system), where the participating DBMSs are loosely coupled and have a degree of
local autonomy. Many DDBMSs use a client-server architecture.

FUNDAMENTALS OF DATABASE SYSTEMS 8

You might also like