Data abstraction in (Database management system)DBMS means hiding the complexity of data from the users. while creating the data developers can use complex data structures to represent the data in the database. since the users that are using these data are not aware of the complexity of the data. so the developers hide the complex part of the data in different levels so that the user can get the data in a simple form. and the hiding of data is called data abstraction in DBMS.
Three levels of Data Abstraction
- Physical level
- Logical Level
- View Level
Physical level
This is the lowest level of abstraction that describes how the data is actually stored. this level describes the complex part of the data structure in detail.
Logical level
This is the higher level than the physical level that describes what data are stored in the database and the relationship among those data. it describes the database in a small number of relatively simple structures. although some complex physical level structures are present at this level users don’t need to worry about that complexity part.
View Level
This is the highest level of abstraction that describes the entire database. it may happen that all the users may not need all the information or data that is present in the database. so this level defines some views so that the required view can be loaded on a request.
[br]
three levels of data abstraction |
For example, we have described a record as follows
type instructor = recordID : char (5);name : char (20);dept name : char (20);salary : numeric (8,2);end;
[br]
we have defined a new record of a type called instructor with four fields and each field has a name and a type associated with it. we can also define some more records types like
[br]
- department record with fields dept_name, building, and budget
- course record with fields course_id, title, dept_name, and credits
- student record with fields ID, name, dept_name, and tot_cred
[br]
At the physical level, the records can be described as a block of consecutive storage locations just like we define instructor, department, or student records.
[br]
At the logical level, each record is described by the type definition, just like in the above code we define the interrelationship of these records.
[br]
At the view level, several views of the database are defined and a user can see some or all of these views. and at this point views also provide a security mechanism to prevent users from accessing certain parts of the database.
Instances and schemas in DBMS
The collection of information stored in the database at a particular time is called an instance of the database and the overall design of the database is called the database schema.
[br]
Whenever the information is inserted and deleted the database change with changes. also the schemas of the database change infrequently. we can understand the schemas and instances of the database by analogy to a program written in a programming language.
[br]
A database schema corresponds to the variable declarations with the associated type definitions in a program. each variable has its particular value at a given instant. and the value of the variable in a program corresponds to an instance of a database schema.
[br]
Database systems have many schemas, that are partitioned according to the abstraction levels. the physical schema describes the database design at the physical level and the logical schema describes the database design at the logical level. a database may also have several schemas at the view level, called subschemas that describe the different views of the database.
[br]
programmers use logical schema to construct the applications. the physical schema is hidden at the logical schema and can usually be hung easily without affecting application programs.