A subschema is a database view that filters or organizes all data to reflect what is visible to a specific user or application. When building applications, software developers use subschemas to access only a narrow portion of a broader database. An example of a definition for a subschema might include:
- A unique subschema name
- The name of the schema from which it is derived
- One or more record types/views
- One or more set types/views
Schema vs. subschema
A schema is the structure of a database system written in a formal language, and a subschema adds restrictions to the structural properties it inherits from a schema. Much like a parent/child relationship, one schema can have multiple subschemas, but one subschema can only be attributed to one schema. A subschema is also not unique to any particular application since more than one application can use the same subschema.
Subschemas are beneficial because they exclude data that isn’t directly relevant to a particular task or application, so it’s easier to focus on what’s important. They are also beneficial for security because administrators can restrict the visibility of sensitive information and the functions that can be performed on different subschemas.