
an entity-relationship diagram, or ER diagram). The term database schema is also sometimes used to refer to other things, such as a flowchart that provides a visual representation of a database (i.e.
Useful for security and access management. A collection of user-chosen database objects such as tables, views, etc. We could do this by creating a user-defined schema called logistics that contains only the database objects ( orders, shipments) that we want the logistics team to be able to access. This type of schema is more precisely called user-defined schema, so to avoid confusion, we’ll use that term for the remainder of this article.Ī single database may have multiple user-defined schema, and different user-defined schemas can be used to give different users or user groups access to different parts of the database.įor example, let’s say we have a logistics team and we want to give them access to orders and shipments tables while keeping them from accessing the PII (personally identifiable information) in our customers table. The term “schema” is sometimes used to represent a named group of database objects. In SQL databases, the term database schema can also have another, more specific meaning. But first, to avoid confusion we need to understand a few other ways the term database schema gets used.
In this article, we’ll focus primarily on the above definition of database schema, as architects and developers must think carefully about their schema design prior to creating and implementing a database.
Accomplishes the above through the implementation of coded rules. Defines how elements within a database relate to each other. Defines how data in a database is structured. The resulting design is called the database schema. It reflects the design of your database, and it’s always best to design before you start building! An architect or developer considers what is required based on the data model or application, and then makes decisions about the tables, data types, foreign key constraints, etc. In this context, the database schema is typically something that’s typically planned prior to the creation of a new database.
However, the schema itself exists in the database as the coded rules that define the data’s structure and relationships. This information is often presented visually with diagrams that illustrate how different tables and elements connect and to give you a logical view of the entire database. In the context of generally discussing a database and how it’s organized, the term database schema describes the structure of the data and how the elements within the database relate to each other. Depending on the context, it can mean different things. That’s actually a bit of a difficult question to answer! Like many database terms, database schema gets used in a variety of contexts.