View of Data in DBMS | Levels of Abstraction, Schemas & Data Models Explained
View of Data in Database Management Systems (DBMS)
Introduction
A Database Management System (DBMS) is a collection of data and programs that allow users to access, modify, and manage this data efficiently. A major purpose of DBMS is to provide an abstract view of the data, hiding the complexities of how data is stored and maintained.
1. Data Abstraction
Data abstraction in DBMS simplifies user interaction by organizing data into different levels of abstraction. This approach helps in hiding the complexities of data storage and retrieval.
Levels of Data Abstraction:
- Physical Level: Describes how data is stored using low-level structures like indexes and blocks. This level is hidden from users and programmers.
- Logical Level: Describes what data is stored and the relationships among them. Database administrators work at this level.
- View Level: Provides customized views for different users, showing only relevant parts of the database. It simplifies user interaction and enforces security by restricting access to specific data.
- Physical Level: Data stored as binary files on disk.
- Logical Level: Data represented as tables like
Students
andCourses
. - View Level: A clerk sees only student names and grades, while administrators see all student records.
2. Instances and Schemas
A database changes over time as new data is added or deleted. To manage this, DBMS differentiates between the database structure (schema) and its content (instance).
Key Concepts:
- Instance: The data stored in the database at a particular moment. For example, the current records of students enrolled in a university.
- Schema: The overall design of the database. It is relatively static and defines the structure of tables, fields, and relationships.
3. Data Models
A data model is a conceptual framework for describing data, their relationships, and constraints. It provides the foundation for designing a database at all levels of abstraction.
Types of Data Models:
- Relational Model: Uses tables (relations) to represent data and their relationships. Each table has rows (records) and columns (attributes). This is the most widely used model.
- Entity-Relationship (E-R) Model: Represents data as entities and their relationships. It is commonly used in database design.
- Object-Based Model: Extends the E-R model by incorporating object-oriented concepts like classes, encapsulation, and inheritance.
- Semistructured Model: Allows flexible structures where data items of the same type can have different attributes. XML is a common example.
- Relational Model: Student data stored in a table with columns like
ID
,Name
, andDepartment
. - E-R Model: Entities like
Student
andCourse
connected by relationships likeEnrolled
.
Conclusion
Understanding the view of data, including levels of abstraction, instances, schemas, and data models, is essential for efficient database design and management. This knowledge is critical for students preparing for exams like GATE, UGC NET, and ISRO, as well as professionals working in database administration and development.