Database Management System · Unit 1
Database Fundamentals and Architecture
Exam-focused notes for Database Fundamentals and Architecture (Database Management System, BIT202): what the TU syllabus asks and how it has actually been tested, with 8 solved past questions from this unit.
Database Fundamentals and Architecture in short
A database system stores large amounts of related data and lets many users share it safely. This chapter explains what a database is, why a DBMS beats plain files, and how the three-schema architecture keeps data and programs independent.
What this unit covers
- Database definition and characteristics
- Advantages of DBMS over file systems
- Three-schema architecture layers
- Logical and physical data independence
- Database users and roles
- Data models, schemas, and instances
Three-schema architecture layers
2082 · 5 marks
Describe the three schema architecture. How does the architecture create data independence? [5]
Show solved answerHide answer
Three Schema Architecture and Data Independence
Three Schema Architecture
The three schema architecture (also called the ANSI/SPARC architecture) is a framework for database systems that separates the database into three distinct levels or schemas. This architecture was proposed to achieve data independence and support multiple user views.
The Three Levels
1. External Level (View Level)
- The highest level of abstraction, closest to the end users.
- Describes how individual users or groups of users see the data.
- Each user group has its own external schema (user view), showing only the portion of the database relevant to that user.
- Different users can have different views of the same data.
- Example: A student may see only their own grades, while a teacher sees all student grades.
2. Conceptual Level (Logical Level)
- The middle level, representing the community or organizational view of the entire database.
- Described by a conceptual schema, which defines:
- All entities, attributes, and relationships
- Constraints, security, and integrity rules
- Hides the physical storage details but describes what data is stored and how it is logically structured.
- Managed by the Database Administrator (DBA).
3. Internal Level (Physical Level)
- The lowest level, closest to physical storage.
- Described by an internal schema, which defines:
- How data is physically stored on disk
- File organization, indexing, hashing, access paths
- Storage allocation and compression
- Deals with the actual implementation of the database.
Diagram
+-----------------------------+
| External Schema 1 | External Schema 2 | ... | <- External Level
+-----------------------------+
|
+-----------------------------+
| Conceptual Schema | <- Conceptual Level
+-----------------------------+
|
+-----------------------------+
| Internal Schema | <- Internal Level
+-----------------------------+
|
+-----------------------------+
| Physical Database |
+-----------------------------+
How the Architecture Creates Data Independence
Data independence is the ability to change the schema at one level without having to change the schema at the next higher level. The three schema architecture achieves this through two types of mappings:
1. Logical Data Independence
- The ability to change the conceptual schema without changing the external schemas or application programs.
- Example: Adding a new attribute (column) to a table, or splitting a table, does not affect the user views as long as the mapping between external and conceptual levels is updated.
- This is harder to achieve in practice.
2. Physical Data Independence
- The ability to change the internal schema without changing the conceptual schema.
- Example: Changing the file organization from sequential to indexed, or moving data to a different storage device, does not affect the logical structure.
- This is easier to achieve and is supported by most DBMS.
Summary Table
| Change Made At | Does Not Affect | Type of Independence |
|---|---|---|
| Internal Schema | Conceptual Schema | Physical Data Independence |
| Conceptual Schema | External Schema | Logical Data Independence |
Conclusion
The three schema architecture creates data independence by introducing clear separation between how data is physically stored, how it is logically organized, and how it is viewed by users. The mappings between levels ensure that changes at one level are translated appropriately, shielding higher levels from lower-level changes. This reduces maintenance cost, improves flexibility, and allows the database to evolve without disrupting existing applications.
2080 · 5 marks
What is data independence? How three schema architecture ensures logical and physical data independence? [5]
Show solved answerHide answer
Data Independence and Three Schema Architecture
What is Data Independence?
Data independence is the ability to modify the schema definition at one level of the database system without affecting the schema definition at the next higher level.
In simple terms, it means changes made to the structure or storage of data do not require changes to the application programs that use the data.
There are two types of data independence:
| Type | Description |
|---|---|
| Logical Data Independence | Ability to change the conceptual schema without changing external schemas or application programs |
| Physical Data Independence | Ability to change the internal/physical schema without changing the conceptual schema |
Three Schema Architecture
The ANSI/SPARC Three Schema Architecture divides the database into three levels:
+-----------------------------+
| External Level (View) | <-- User views / subschemas
+-----------------------------+
| Conceptual Level | <-- Logical structure of entire DB
+-----------------------------+
| Internal Level | <-- Physical storage details
+-----------------------------+
-
External Schema (View Level): Describes how individual users or groups see the data. Different users can have different views.
-
Conceptual Schema: Describes the overall logical structure of the entire database -- what data is stored, relationships, constraints, etc.
-
Internal Schema: Describes the physical storage structure -- file organization, indexes, access paths, etc.
How Three Schema Architecture Ensures Data Independence
1. Physical Data Independence
- Achieved through the mapping between Internal and Conceptual levels.
- If the physical storage is changed (e.g., changing file organization, adding indexes, moving data to new storage), only the internal schema and its mapping to the conceptual schema need to be updated.
- The conceptual schema remains unchanged, so application programs and user views are not affected.
- Example: Changing a sequential file to a B-tree index does not affect the logical description of the data.
2. Logical Data Independence
- Achieved through the mapping between Conceptual and External levels.
- If the conceptual schema is changed (e.g., adding a new attribute, splitting a table), only the mapping between conceptual and external schemas needs to be updated.
- The external schemas (user views) remain unchanged, so application programs are not affected.
- Example: Adding a new column to a table does not affect existing user views that do not use that column.
Summary
Change in Internal Schema
|
v
Update Internal-Conceptual Mapping --> Physical Data Independence
|
v
Conceptual Schema unchanged
|
v
Update Conceptual-External Mapping --> Logical Data Independence
|
v
External Schema (Applications) unchanged
The three schema architecture acts as a buffer between levels, ensuring that changes at one level are isolated from other levels, thus providing both physical and logical data independence.
2079 · 5 marks
What are the three layers of the Three-Schema Architecture? Explain. [5]
0 · 5 marks
What is data independence? How three schema architecture ensures logical and physical data independence? [5]
Show solved answerHide answer
Data Independence and Three Schema Architecture
What is Data Independence?
Data independence is the ability to modify the schema definition at one level of the database system without affecting the schema definition at the next higher level.
It means that changes made to the structure or storage of data should not require changes to the application programs that use the data.
There are two types of data independence:
1. Logical Data Independence
The ability to change the conceptual schema without having to change the external schemas (user views) or application programs.
- Example: Adding a new attribute to a table, splitting a table, or merging tables should not affect existing user views or applications.
2. Physical Data Independence
The ability to change the internal/physical schema without having to change the conceptual schema (or external schemas).
- Example: Changing file organization, indexing strategy, or storage devices should not affect the logical structure of the database.
Three Schema Architecture
The Three Schema Architecture (proposed by ANSI/SPARC) divides the database into three levels:
| Level | Schema | Description |
|---|---|---|
| External Level | External Schema | Individual user views |
| Conceptual Level | Conceptual Schema | Logical structure of entire database |
| Internal Level | Internal Schema | Physical storage details |
External Level: [View 1] [View 2] [View 3]
| | |
(External/Conceptual Mapping)
|
Conceptual Level: [Conceptual Schema]
|
(Conceptual/Internal Mapping)
|
Internal Level: [Internal Schema]
|
[Physical Database]
How Three Schema Architecture Ensures Data Independence
Logical Data Independence (via External/Conceptual Mapping)
- The mapping between external schema and conceptual schema is maintained by the DBMS.
- When the conceptual schema changes (e.g., a new column is added), only the external/conceptual mapping needs to be updated.
- The external schemas and application programs remain unchanged.
- This is harder to achieve because application programs are closely tied to the logical structure.
Physical Data Independence (via Conceptual/Internal Mapping)
- The mapping between conceptual schema and internal schema is maintained by the DBMS.
- When the internal schema changes (e.g., a new index is created, or data is moved to a different disk), only the conceptual/internal mapping needs to be updated.
- The conceptual schema remains unchanged, and therefore external schemas and applications are also unaffected.
- This is relatively easier to achieve and is well supported by most modern DBMS.
Summary
The three schema architecture achieves data independence by providing two levels of mappings (external/conceptual and conceptual/internal). Changes at one level are absorbed by updating the corresponding mapping, so the levels above remain unaffected. This insulates users and applications from physical and logical changes in the database.
Advantages of DBMS over file systems
2080 · 5 marks
What are the Advantages of using DBMS? Explain in brief. [5]
Database definition and characteristics
2079 · 5 marks
What is Database? Explain the characteristics of Database Approach. [5]
Database users and roles
2078 · 5 marks
What are different types of Database Users? Explain in Brief. [5]
Data models, schemas, and instances
Make Unit 1 stick
Practice BIT202 with flashcards & quizzes