It is the structure of database. Schema defines how the data will be stored in the database, relationship between entities and attributes and so on. Â
The overall structure or the overall design of a database is the database schema. The term “schema” refers to the organization of data as a blueprint of how the database is constructed. The schema is a complete description of a database.
A schema contains schema objects, which could be tables, columns, data types, views, stored procedures, relationships, primary keys, foreign keys, etc. It describes the overall database.
Schema is of three types:
   Physical Schema/Internal Schema: It describes the database design at the physical level. The physical schema defines how database is stored in secondary storage.
Â
   Logical Schema/Conceptual Schema: It describes the database design at the logical level. This schema defines logical structure of a database.
Â
   View Schema/External Schema: It defines the design of the database at the view level.
Â
Â
Subschema:
It is the subset or sub part of the schema having the same properties that a schema has. It identifies a subset of areas, sets, records and data names defined in the database schema
Subschema describes different view of the database. A subschema lets the user have access to different areas of application in which the user designed. Schemas may have many different sub schemas that are all very different.
Â
For example:Â Suppose a table student, programmer has access of all columns of table student but user has access of only two or three columns of table student.
Â
Â