IM 101 - Fundamentals of Database Systems - Unit 5
IM 101 - Fundamentals of Database Systems - Unit 5
All rights reserved. No part of this module may be reproduced, repurposed, distributed, or transmitted in
any form or by any means including photocopying, reprinting, or other electronic or mechanical
methods without the prior written permission of PLV and the individual developers of instructional
materials (IMs) except in the case of brief quotations embodied in critical and creative reviews and
certain other noncommercial uses permitted by the Copyright Law. For permission request, address your
written correspondence whether printed or electronic to the Chair of the University Committee on
Instructional Materials Development and Evaluation at the address below:
Essential Question
Why is the data model needed?
What elements comprise a database schema?
How can we differentiate the different database schema?
Lessons Input
A data model or a schema is a collection of high-level data description constructs that hide many
low-level storage details. A DBMS allows a user to define the data to be stored in terms of a data
model. Most database management systems today are based on the relational data model.
A semantic data model is a more abstract, high-level data model that makes it easier for a user to
come up with a good initial description of the data in an enterprise. These models contain a wide
variety of constructs that help describe a real application scenario. It focuses on providing more
meaning of the data itself, rather than solely or primarily on the relationships and attributes of the
data.
Semantic data model provides a high-level understanding of the data by abstracting it further away
from the physical aspects of data storage.
2
Journey IS AN Artist
An Artist RECORDS an Album
An Album CONTAINS songs
A song MAY CONTAIN lyrics
Raised on Radio is an INSTANCE OF an Album (or a TYPE OF)
Are the actual PHYSICAL storage structure and access paths. It defines the physical storage structure of
the database. It is a very low-level representation of the entire database. It contains multiple occurrences
of multiple types of internal records. In the ANSI term, it is also called "stored record'.
The physical/internal schema specifies additional storage details. Essentially, the physical schema
summarizes how the relations described in the conceptual schema are stored on secondary storage
devices such as disks and tapes. We must decide what file organizations to use to store the relations
and create auxiliary data structures, called indexes, to speed up data retrieval operations.
A sample physical schema for the university database follows:
Store all relations as unsorted files of records. (A file in a DBMS is either a collection of
records or a collection of pages, rather than a string of characters as in an operating system.)
Create indexes on the first column of the Students, Faculty, and Courses relations, the salary
column of Faculty, and the capacity column of Rooms.
Decisions about the physical schema are based on an understanding of how the data is typically
accessed. The process of arriving at a good physical schema is called physical database design.
2. Conceptual/Logical Schema
4
The conceptual schema describes the Database structure of the whole database for the community of
users. This schema hides information about the physical storage structures and focuses on describing
data types, entities, relationships, etc.
This logical level comes between the user level and the physical storage view. However, there is an only
a single conceptual view of a single database.
The conceptual schema (sometimes called the logical schema) describes the stored data in terms of the
data model of the DBMS. In a relational DBMS, the conceptual schema describes all relations that are
stored in the database. For example, these relations contain information about entities, such as students
and faculty, and about relationships, such as students' enrollment in courses.
3. External/View Schema
An external schema describes the part of the database that a specific user is interested in. It hides the
unrelated details of the database from the user. There may be "n" number of external views for each
database.
Each external view is defined using an external schema, which consists of definitions of various types of
external record of that specific view.
An external view is just the content of the database as it is seen by some specific particular users. For
example, a user from the sales department will see only sales-related data.
An external level is only related to the data which is viewed by specific end users.
This level includes some external schemas.
The external schema level is nearest to the user
The external schema describes the segment of the database which is needed for a certain user
group and hides the remaining details from the database from the specific user group
External schemas, which usually are also in terms of the data model of the DBMS, allow data access to
be customized (and authorized) at the level of individual users or groups of users. Any given database
has exactly one conceptual schema and one physical schema because it has just one set of stored
relations, but it may have several external schemas, each tailored to a particular group of users. Each
external schema consists of a collection of one or more views and relations from the conceptual schema.
5
A view is conceptually a relation, but the records in a view are not stored in the DBMS. Rather, they are
computed using a definition for the view, in terms of relations stored in the DBMS.
A DBMS enables users to create, modify, and query data through a data manipulation language (DML).
Thus, the query language is only one part of the DML, which also provides constructs to insert, delete,
and modify data.
Summary
There are mainly three levels of data abstraction: Physical or Internal Level, Conceptual or
Logical Level, or External or View level
The internal schema defines the physical storage structure of the database
The conceptual schema describes the Database structure of the whole database for the
community of users
An external schema describes the part of the database which a specific user is interested in
6
DBMS Architecture allows you to make changes on the presentation level without affecting the
other two layers
References
Garcia-Molina, H.,Ullman, J.,Widom, J. (2008). Database Systems: The Complete Book (2nd ed., pp 15-
55). Pearson