Levels of Abstraction
Explain in detail the different levels of abstraction.
There are three levels of abstraction
1. Physical level
-In data abstraction, the Physical level is the lowest level. This level describes how the data is actually stored in the physical memory.
-The physical memory may be hard disks, magnetic tapes, etc. At Physical level the methods like hashing are used for organization organizational purposes.
-Developer would know the requirement, size, and accessing frequency of the records clearly in this level which makes it easy to design this level.
2. Logical level
-This is the next higher level of abstraction which is used to describe what data the database stores, and what relationships exist between the data items. The logical level thus describes an entire database in terms of a small number of relatively simple structures.
-Although the implementation of the simple structures at the logical level may involve complex physical level structures, the user of the logical level does not need to be aware of this complexity. This is considered physical data independence.
-Database administrators use the logical level of abstraction to decide what information to keep in a database.
3. View level
-It is the highest level of abstraction. This level describes the user interaction with the database system. At the logical level, simple structures are used but still, complexity remains because in the large database various type of information is stored.
-Many users are not aware of the technical details of the system, and also they need not access whole information from the database. Hence it is necessary to provide a simple and short interface for such users as per their requirements. Multiple views can be created for the same database for multiple users.
Example: Consider that we are storing information of all the employees of an organization in the employee table. At the physical level, these developer records can be described as blocks of storage (bytes, gigabytes, terabytes, etc.) in memory. These details are usually hidden from the developer.
-The records can be described as fields and attributes along with their data types at the logical level. The relationship between these fields can be implemented logically. Usually, the developer works at this level because they have knowledge of such things as database systems.
-End user interacts with a system with the help of GUI and enters the details at the screen at the view level. User is not aware of how the data is stored and what data is stored; such details are hidden from them.
-Schema
The design of a database is called the schema. To understand schema we can consider an example of a program of an application. A variable or array declared with its structure (data type and/or size) is a schema. The schema changes or is not frequent.
Types of Schema: According to the level of abstraction, the database schema is divided into three types: Physical schema, Logical schema, and View schema.
(i) Physical schema is the design of a database at the physical level, i.e. how the data stored in the blocks of storage is described at this level.
(ii) Logical schema is the design of a database at a logical level. Developers and database administrators work at this level. Here the data can be described as certain types of data records get stored in data structures, however, the internal details like the implementation of the data structure are hidden at this level.
(III) View schema refers to the design of a database at the view level. This usually describes the end-user interaction with database systems. There may be multiple schemas at the view level.
-Instance
In database changes are quite frequent i.e. insertion, deletion or updation are the frequent operations in the database.
The data is stored in the database at a particular moment and is called an instance of the database. In the example of the application program, the value of a variable at a particular time or situation is called an instance of the database schema.
Comments
Post a Comment