The objective of database schema is to recognize different tables and fields of each table. Schema also describes how the relationship is established between tables. This helps to identify constraints in the system.
The subschema is a subset of the schema and the subschema inherits the same property as the schema.
The schema can be divided into two parts
- Physical schema
- Logical schema
a) Physical schema – Physical schema defines how data is represented in DBMS and how data is stored in it. It is basically related to the data structure used to achieve the schema of the database. Ex: B-tree, Hashing, etc. Physical schema is like the physical structure of human body.
b) Logical schema – This schema defines all the logical constraints applied in storing data. A logical schema is a conceptual model of data. This kind of schema is related to the working of logic and concepts used in the database to maintain the proper functioning of a database. A logical schema is just like the internal workings of the human body.