Database Management System · Unit 2 · 3 hrs
Database System – Concepts and Architecture
Exam-focused notes for Database System – Concepts and Architecture (Database Management System, CSC265): what the TU syllabus asks and how it has actually been tested, with 6 solved past questions from this unit.
Database System – Concepts and Architecture in short
This unit looks at how a database system is organized internally: the models used to describe data at different levels of detail, the three-schema architecture that keeps those levels independent of one another, the languages and interfaces a DBMS exposes, and the ways a DBMS can be deployed across one machine or many.
What this unit covers
- Data Models, Schemas, and Instances
- Three-Schema Architecture and Data Independence
- Database Languages and Interfaces
- the Database System Environment
- Centralized and Client/Server Architectures for DBMSs
- Classification of Database Management Systems
Data Models, Schemas, and Instances
2080 · 5 marks
Define data abstraction, data model, schemas, instances and database state. [5]
2079 · 5 marks
What do you mean by Schema and Instance in DBMS? Explain both with examples. [5]
Three-Schema Architecture and Data Independence
2079 · 10 marks
What is Database Management System? Explain the DBMS architecture with a diagram. What is data independence?[10]
Show solved answerHide answer
Database Management System (DBMS) - Model Answer
1. What is a Database Management System? (2 marks)
A Database Management System (DBMS) is a collection of the database, its processing methods, and the set of rules and conditions to be followed for managing data. It is the way to store data and also provides a mechanism for manipulation of data. It is basically a computerized record-keeping system.
In simple terms, a DBMS allows users to:
- Store data in an organized manner
- Retrieve data efficiently
- Manipulate data (insert, update, delete, query)
- Protect data from unauthorized access and system failures
Examples: Oracle, MS SQL Server, DB2, MySQL
2. DBMS Architecture (Three-Schema Architecture) (5 marks)
The most widely accepted architecture for a DBMS is the Three-Schema Architecture (also called the ANSI/SPARC architecture). It separates the user's view of the database from the physical storage of data.
Diagram
+---------------------------+ +---------------------------+ +---------------------------+
| External View 1 | | External View 2 | | External View 3 |
| (End User / App 1) | | (End User / App 2) | | (End User / App 3) |
+---------------------------+ +---------------------------+ +---------------------------+
| | |
+-------------------------------+-------------------------------+
|
[ EXTERNAL LEVEL ]
(Multiple External/User Views)
|
External / Conceptual Mapping
|
[ CONCEPTUAL LEVEL ]
(Conceptual Schema)
|
Conceptual / Internal Mapping
|
[ INTERNAL LEVEL ]
(Internal Schema)
|
+------------+------------+
| Stored Database |
+-------------------------+
Description of Each Level
a) External Level (View Level)
- This is the highest level of abstraction.
- It describes how individual users or groups of users see the data.
- Different users may have different views of the same database.
- Each external view is defined by an external schema (also called a subschema).
- Example: A student may see only their own marks, while a teacher sees all students' marks.
b) Conceptual Level (Logical Level)
- This is the middle level of abstraction.
- It describes what data is stored in the database and the relationships among the data.
- It is defined by a conceptual schema.
- It hides the details of physical storage and focuses on the logical structure.
- Example: Tables, attributes, relationships, constraints.
c) Internal Level (Physical Level)
- This is the lowest level of abstraction.
- It describes how data is physically stored on the storage medium.
- It is defined by an internal schema.
- It deals with storage allocation, indexing, hashing, etc.
- Example: File structures, B-trees, storage blocks.
Mappings
The process of transforming requests and results between levels is called mappings:
| Mapping | Description |
|---|---|
| External / Conceptual Mapping | Transforms user view requests to the conceptual schema |
| Conceptual / Internal Mapping | Transforms conceptual schema requests to physical storage |
Note: The three schemas are only descriptions of data. The actual data is stored at the physical (internal) level only. Most DBMSs do not completely separate the three levels but support this architecture to some extent.
3. Data Independence (3 marks)
Data independence is the capacity to change the schema at one level of a database system without having to change the schema at the next higher level.
It is one of the most important advantages of the three-schema architecture.
There are two types of data independence:
a) Logical Data Independence
"It is the capacity to change the conceptual schema without having to change external schemas or application programs."
- We may change constraints, add new entities, or reduce the database at the conceptual level.
- Only the view definition and the external/conceptual mapping need to be updated.
- Application programs that refer to the external schema remain unaffected.
- Example: Adding a new attribute (column) to a table should not affect existing user views or application programs.
b) Physical Data Independence
- It is the capacity to change the internal schema without having to change the conceptual schema.
- Changes in physical storage (e.g., changing file organization, indexing method) do not affect the logical structure.
- Only the conceptual/internal mapping needs to be updated.
- Example: Changing from sequential file storage to indexed storage should not affect the conceptual schema or user views.
Summary Table
| Type | Change at Level | No Change Required at |
|---|---|---|
| Logical Data Independence | Conceptual Level | External Level / Application Programs |
| Physical Data Independence | Internal Level | Conceptual Level |
Key Point: Data independence is achieved through the three-schema architecture and its mappings. It allows the database to evolve without disrupting existing users or applications, making the system flexible and maintainable.
2078 · 5 marks
What is difference between logical data independence and physical data independence? [5]
2076 · 5 marks
What is data abstraction? What are three levels of data abstraction? Explain. [5]
2080.1 · 5 marks
Define data independence. Explain three-schema architecture. [5]
Show solved answerHide answer
Data Independence and Three-Schema Architecture
Data Independence
Data independence is the capacity to change the schema at one level of a database system without having to change the schema at the next higher level.
There are two types of data independence:
1. Logical Data Independence
It is the capacity to change the conceptual schema without having to change the external schemas or application programs. For example, we may add new entity types, change constraints, or reduce the database. Only the view definition and mappings need to be updated; the external/user views remain unaffected.
2. Physical Data Independence
It is the capacity to change the internal schema without having to change the conceptual schema (and hence the external schemas also need not change). Changes to the internal schema may be needed because physical files were reorganized or storage structures were modified. As long as the same data remains in the database, the conceptual schema should not need to change.
Three-Schema Architecture
The goal of the three-schema architecture is to separate user applications from the physical database, thereby achieving data independence and data abstraction.
The three schemas are only descriptions of data; the actual data is stored at the physical level only. Requests and results are transformed between levels through a process called mappings.
External Users
|
[External Level] -- External Views (View 1, View 2, ...)
|
External/Conceptual Mapping
|
[Conceptual Level] -- Conceptual Schema
|
Conceptual/Internal Mapping
|
[Internal Level] -- Internal Schema
|
Stored Database
Level 1: External Level (View Level)
- The highest level of abstraction.
- Describes the part of the database that a particular user group is interested in.
- Each user group has its own external view (also called a subschema).
- Hides the rest of the database from that user group.
- Defined using View Definition Language (VDL).
Level 2: Conceptual Level
- Describes what data is stored in the database and the relationships among the data for the entire organization.
- Hides the details of physical storage structures.
- Represents the logical structure of the whole database (entities, attributes, constraints, relationships).
- Defined using Data Definition Language (DDL).
Level 3: Internal Level (Physical Level)
- The lowest level of abstraction.
- Describes how data is physically stored on storage media (file organization, indexing, access paths, record formats, etc.).
- Defined using Storage Definition Language (SDL).
Summary Table
| Level | Also Called | Describes | Language |
|---|---|---|---|
| External | View Level | User-specific views | VDL |
| Conceptual | Logical Level | Whole database structure | DDL |
| Internal | Physical Level | Physical storage details | SDL |
Note: Most DBMSs do not completely and explicitly separate the three levels, but they support the three-schema architecture to some extent.
Make Unit 2 stick
Practice CSC265 with flashcards & quizzes