Database systems are made up of complex data structures. To ease user interaction with the database, developers hide internal irrelevant details from users and provide an abstract view of data. This process of hiding irrelevant details from users is called Data Abstraction.
Abstraction is one of the main features of database systems.
View Level: Users interact with the system with the help of a GUI and enter the details on the screen. They are not aware of how the data is stored and what data is stored; such details are hidden from them.
Logical Level: At this level, records can be described as fields and attributes along with their data types, and their relationships among each other can be logically implemented. Programmers generally work at this level because they are aware of such things about database systems.
Physical Level: At this level, records can be described as blocks of storage (bytes, gigabytes, terabytes, etc.) in memory. These details are often hidden from programmers.
This version ensures the conditions for compatibility are clear and corrects any grammatical or conceptual errors.
Schemas and instances are similar to data types and variables in programming languages.
Schema: The overall design of a database is called the schema.
For example, given a schema that shows the relationship between three tables: Course, Student, and Section. The diagram only shows the design of the database, not the data present in those tables. The schema is only a structural view (design) of a database.
Schema is of three types:
Physical Schema: It describes the database design at the physical level, i.e., the physical structure of the database and how the data stored in blocks of storage is described at this level.
Logical Schema: It describes the database design at the logical level, i.e., the logical structure of the database. Programmers and Database Administrators work at this level. At this level, data can be described as certain types of data records stored in data structures. However, the internal details such as the implementation of the data structure are hidden at this level (available at the physical level).
Sub-schema (or View Schema): It describes different views of the database and generally describes end-user interaction with database systems.
Instance: The data stored in the database at a particular moment in time is called the instance of the database. For example, if we have a single table Student in the database, today the table has 100 records. So today, the instance of the database has 100 records. If we add another 100 records to this table by tomorrow, the instance of the database tomorrow will have 200 records. In short, at a particular moment, the data stored in the database is called the instance, which changes over time when we add or delete data from the database.
Database schema defines the variable declarations along with type definitions in tables that belong to a particular database. The value of these variables at a moment in time is called the instance of that database.
The ability to modify the schema at one level of the database system without altering the schema at the next higher level is called data independence. There are two types of data independence:
1.Logical Data Independence: The ability to modify the logical schema without changing the external view and application.
2.Physical Data Independence: The ability to modify the physical schema without changing the logical schema.