Why is there no definition or syntax for the concept of "Database" in the SQL standard?

214 views Asked by At

I browsed ISO/IEC 9075:1992, and ISO/IEC 9075-4:2011, I found that the term "database" is not discussed. Such as the definition of "database", There is also no standard syntax specified for operations such as create database, use database, etc.

The documentation for CREATE DATABASE here explains

The ANSI/ISO standard for the SQL language does not specify any syntax for construction of a database, the process by which a database comes into existence and has its name declared.

I do not understand this omission from the standard, could any one explain it?

1

There are 1 answers

0
Bill Karwin On BEST ANSWER

The term "database" is an invention of different RDBMS implementors, and they use the term in nonstandard ways. Don't expect the term database to be used the same between vendors.

The ANSI/ISO SQL standard defines catalogs and schemas. Not all vendors implement these according to the SQL standard, and some have changed their implementation over time.

https://mariadb.com/kb/en/library/sql-99/catalog/ says in part:

A Cluster may contain zero or more Catalogs. An SQL Catalog is a named group of Schemas, one of which must be an Ur-Schema named INFORMATION_SCHEMA. (The INFORMATION_SCHEMA Schema is a set of Views and Domains that contain the descriptions of all the SQL-data belonging to that Catalog.) Catalogs are dependent on some Cluster — the Catalog name must be unique within the Cluster the Catalog belongs to — and are created and dropped using implementation-defined methods.

Schemas are known as Catalog Objects and, as already stated, a Catalog may consist of one or more Schemas. The Catalog's name qualifies the names of the Schemas that belong to it, and can either be explicitly stated, or a default name will be supplied by your DBMS.

https://mariadb.com/kb/en/library/sql-99/17-sql-schemas-schema/ says in part:

A Catalog may contain one or more Schemas. An SQL Schema is a named group of SQL-data that is owned by a particular AuthorizationID. Schemas are dependent on some Catalog — the Schema name must be unique within the Catalog to which the Schema belongs — and are created, altered, and dropped using the SQL-Schema statements. The Objects that may belong to a Schema are known as Schema Objects; that is, they depend on some Schema. Every Schema Object has a name that must be unique (among Objects of its name class) within the Schema to which it belongs. The Schema Object name classes are:

  • Base tables and Views.
  • Domains and UDTs.
  • Constraints and Assertions.
  • Character sets.
  • Collations.
  • Translations.
  • Triggers.
  • SQL-server Modules.
  • SQL-invoked routines.

A Schema may consist of zero or more of these Schema Objects. The Schema's name qualifies the names of the Objects that belong to it, and can either be explicitly stated, or a default name will be supplied by your DBMS.