Schema vs Database?
A database can be described as a collection of structured data that usually are stored in computer systems. The structure for a database is arrived at by properly organizing the data with the help of a database model. The term “schema” means “a plan or a shape” and can be defined as the terminology used to model or create a logical structure using which data can be stored in a database. Technically speaking, a database schema is the underlying structure described by and supported by the database management system that is used to store records.
Generally, a schema is a higher level of abstraction of the design models which are captured and documented by database designers and business analysts during the analysis phase of a project or product development. They do not exist as such in a database, but in some variants of databases they can be realized at some levels in a physical form.
When we bring a user into this perspective, then we can define these three entities (database, schema, and user) as below:
Database is a collection of physical files.
A user is one who connects to a database.
Schema is the collection of objects which are owned by the user.
To sum it up briefly, a schema is usually a graphical representation of the database system’s structure whereas the database itself is a structured collection of records or data.
Summary:
1.A database is the physical structure.
2.Schema is the logical structure.
3.A database is a collection of related records and data stored in tables.
4.A schema, on the other hand, is a logical definition of the database or, in other words, a blueprint that defines the names of all the tables and columns and defines what type each column is, etc.
5.In some database management systems, a schema can be realized in a physical form at any of the levels.
6.There is no one-on-one correspondence between schema objects and the physical files which store information on disks.