Introduction to database schema and catalog

Source: Internet
Author: User

Press
According to the standard description of SQL, both catalog and Schema are abstract concepts in the SQL environment. They can be understood as a layer in a container or database object namespace.
To solve the naming conflict problem. Conceptually, a database system contains multiple catalog S, each of which contains multiple schemas, and each schema contains multiple data.
Database objects (tables, views, fields, etc.), in turn, a database object must belong to a schema, And the schema must belong to a catalog, so that we can get this number.
The database object's fully qualified name solves the naming conflict problem. For example, the fully qualified name of the database object table can be expressed as: Catalog name. schema name. Table name. Here also
Note that the SQL standard does not require that the fully qualified names of each database object be unique, just like domain names. If you like it, each IP Address can have multiple domain names.

From the implementation point of view, the support and implementation methods for catalog and schema vary widely in various database systems. For specific problems, refer to the specific product manual, A simple and common implementation method is to use the database name as the catalog name and the user name as the schema name. For details, see the following table:

Most
Note that the term schema has different meanings in the SQL environment than in the data modeling field. In the SQL environment, schema is a set of related numbers.
A collection of database objects. The schema name defines a namespace for this group of objects. In the field of data modeling, schema (schema) represents the structure of the database described in the formal language; simple
It can be understood in this way that the schema <that is, metadata> of data modeling is stored in the corresponding catalog in the SQL environment.
In the table under definition_schema>, you can also query another schema in this catalog <name:
The view under information_schema> is obtained without further details.

In addition, I used the MySQL official MySQL administrater database management tool to understand the so-called schema, catalog:

 

Click the catalogs and all databases are displayed below. Let me summarize the following:

Database: Refers to MySQL (or Oracle)

Schema: When I create database caiceclb, caiceclb is a schema.

catalog: refers to all database directories. As shown in, the original MySQL (MySQL, infomation_schema) and the database set created later.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.