DBMS_Database Schemas
DBMS_Database Schemas
Nowadays data is one of the most important things in the business world,
every business captures its customers’ data to understand their behavior, in
the world of the internet, data is growing like crazy, so businesses need more
advanced database solutions, by which they can maintain the database
systems and whenever they need data to solve business problems, they can
easily get what data they want without any problem. To fulfill this condition,
there is a requirement for the database schema in the picture.
What is Schema?
Details of a Customer
Schema of Customer
Database Schema
2. SQL Server: In SQL Server, we use the “CREATE SCHEMA” statement for
creating a new schema.
There are many ways to structure a database, and we should use the best-
suited schema design for creating our database because ineffective schema
designs are difficult to manage & consume extra memory and resources.
1. Flat Model
2. Hierarchical Model
3. Network Model
4. Relational Model
5. Star Schema
6. Snowflake Schema
Flat Model
A flat model schema is a 2-D array in which every column contains the same
type of data/information and the elements with rows are related to each other.
It is just like a table or a spreadsheet. This schema is better for small
applications that do not contain complex data.
Designing Flat Model
Hierarchical Model
Network Model
The network model and the hierarchical model are quite similar with an
important difference that is related to data relationships. The network model
allows many-to-many relationships whereas hierarchical models allow one-to-
many relationships.
Designing Network Model
Relational Model
The relational model is mainly used for relational databases, where the data is
stored as relations of the table. This relational model schema is better for
object-oriented programming.
Star Schema
Star schema is better for storing and analyzing large amounts of data. It has a
fact table at its center & multiple dimension tables connected to it just like a
star, where the fact table contains the numerical data that run business
processes and the dimension table contains data related to dimensions such
as product, time, people, etc. or we can say, this table contains the description
of the fact table. The star schema allows us to structure the data of RDBMS.
Snowflake Schema
Just like star schema, the snowflake schema also has a fact table at its center
and multiple dimension tables connected to it, but the main difference in both
models is that in snowflake schema – dimension tables are further normalized
into multiple related tables. The snowflake schema is used for analyzing large
amounts of data.
Designing Snowflake Schema
Database Instance
The database schema is defined before the actual database is created, after
the database is operational, it is very difficult to modify the schema because
the schema represents the fundamental structure of the database. Database
instance does not hold any information related to the saved data in database.
Therefore database instance represents the data and information that is
currently stored in the database at a specific point in time.