Catalog & Schema

Source: Internet
Author: User

According to the SQL standard, 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, it is mainly used to solve naming conflicts. Conceptually, a database system contains multiple catalog S, each of which contains multiple schemas, and each schema contains multiple 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 the fully qualified name of the database object to solve the naming conflict problem; for example, the fully qualified name of the database object table can be expressed as the catalog name. schema name. table name. Note that the SQL standard does not require that the fully qualified names of each database object be unique, just like domain names, 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:

Supplier

Catalog support

Schema support

Oracle Not Supported Oracle user ID
MySQL Not Supported Database Name
Ms SQL Server Database Name The object owner name, which has changed since version 2005.
DB2 The catalog part is omitted when the database object is specified. Catalog owner name
Sybase Database Name Database owner name
Informix Not Supported No
Pointbase Not Supported Database Name

 

The last note is the schema word. Its meaning in the SQL environment is completely different from that in the data modeling field. In the SQL environment, schema is a collection of related 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 a database described in a formal language. In short, it can be understood as follows, schema <that is, metadata> of data modeling is saved in a table in the corresponding catalog in the SQL environment under the schema <definition_schema>, you can also query the view under another schema in the catalog <information_schema>. The details are not described in detail.

Catalog & Schema

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.