Get the App
SLTechnology News&Howtos  ›  Database  › 

Brief Analysis of schema definition in Database

Shulou Source: shulou.com Published: 2022-06-01 20:22:12 09月28日 Update

The following content mainly brings you a brief analysis of the definition of schema in the database. The knowledge mentioned here, which is slightly different from books, is summed up by professional and technical personnel in the process of contact with users, and has a certain value of experience sharing. I hope to bring help to the majority of readers.

Schema in the database is a collection of database objects, which contains tables, views and other objects. Schema is like a user name. When you access the data table without indicating which schema you belong to, the system automatically adds the default schema.

We will encounter a vague concept in the learning database, which is Schema. Many people do not know much about him. Today, I will introduce this concept in detail for you in the article, which will serve as a reference. I hope it will be helpful to you.

[recommended course: database tutorial]

Schema concept

Schema represents a collection of database objects in a database, which contains a variety of objects, such as tables, views, stored procedures, indexes, and so on. In general, a user corresponds to a set, so in order to distinguish between different sets, it is necessary to give different sets names. The user's schema name is equivalent to the user name and serves as the user's default schema. So the schema collection looks like a user name. For example, when we access a data table, if the table does not indicate which schema it belongs to, the system will automatically add the default schema.

The creation of Schema

It should be noted that the Schema methods to be created in different databases are different, but they all support CREATE SCHEMA statements.

MySQL

In the MySQL database, we can create a database through the CREATE SCHEMA statement

Oracle Database

In Oracle, because the database user has already created a schema, the CREATE SCHEMA statement creates a schema that allows you to associate schema with tables and views, and it's weird to authorize on these objects, so you don't have to issue multiple SQL statements in multiple transactions.

SQL Server

In SQL Server, CREATE SCHEMA creates a schema by name, and unlike MySQL, the CREATE SCHEMA statement creates a schema that is defined separately to the database. Unlike the Oracle database, it actually creates a schema, and once you create a schema, you can add users and objects to the schema.

These are the details of the definition of schema in the database, please pay more attention to other related articles!

Tags: Data database user different schema object statement namely concept user name view content multiple datasheet article system process help following middle table Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Shulou Information vpn Apple NVidia