Database vs Schema
A system intended for easily organizing, storing and retrieving large amounts of data, is called a database. In other words, a database holds a bundle of organized data (typically in digital form) for one or more users. Databases, often abbreviated DB, are classified according to their content, such as document-text, bibliographic and statistical. On the other hand, database schema is the formal description of the organization and the structure of data in the database. This description includes the definitions of tables, columns, data types, indexes and much more.
A database may contain different levels of abstraction in its architecture. Typically, the three levels: external, conceptual and internal make up the database architecture. External level defines how the users view the data. A single database can have multiple views. The internal level defines how the data is physically stored. The conceptual level is the communication medium between internal and external levels. It provides a unique view of the database regardless of how it is stored or viewed. There are several types of databases such as Analytical database, Data warehouses and Distributed databases. Databases (more correctly, relational databases) are made up of tables and they contain rows and columns, much like spreadsheets in Excel. Each column corresponds to an attribute, while each row represents a single record. For example, in a database, which stores employee information of a company, the columns could contain employee name, employee Id and salary, while a single row represents a single employee. A DBMS (Database Management System) is used to manage all the databases in a database system. Typically, the structure of a database is too complex to handle without a DBMS. Popular DBMS products are Microsoft SQL Server, MySQL, DB2, Oracle, and Microsoft Access.
A database schema of a database system describes the structure and the organization of data. A formal language supported by the Database Management System is used to define the database schema. Schema describes how the database will be constructed using its tables. Formally, schema is defined as the set of formula that imposes integrity constraints on the tables. Furthermore, the database schema will describe all tables, column names and types, indexes, etc. There are three types of schema called the conceptual schema, logical schema and physical schema. Conceptual schema describes how concepts and relationships are mapped. Logical schema defines how entities, attributes and relations are mapped. Physical schema is a specific implementation of the aforementioned logical schema.
What is the difference between Database and Schema?
As a summery, a database is a collection of organized data, while database schema describes the structure and organization of data in a database system. The database holds the records, fields and cells of data. The database schema describes how these fields and cells are structured and organized and what types of relationships are mapped between these entities. Understandably, the schema of a database keeps constant once created, while the actual data in the database tables may change all the time.