数据库模式混乱 [英] Database schema confusion

查看:38
本文介绍了数据库模式混乱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在设计一些课程时遇到了一些术语问题.在 Sql Server 2005 中,架构"指的是命名空间和数据库对象的组织系统.但是对于一般的关系数据库,模式"意味着表、字段等的 DDL 设计.如果我对此是正确的,它解释了当我尝试阅读 Microsoft 文档并理解各种数据时的很多不协调访问 API.你能解释一下这里发生了什么吗,模式"的定义真的有那么大的不同吗?

I'm having a slight terminology meltdown as I design some classes. In Sql Server 2005, 'schema' refers to a namespace, and an organizational system for database objects. But for relational databases in general, 'schema' means the DDL design of tables, fields, etc. If I'm right about this, it explains a lot of the dissonance when I am trying to read microsoft documentation, and understand the various data access APIs. Can you explain what's going on here, is there really that much difference in the definition of 'schema'?

推荐答案

是的,不幸的是,模式"这个词在数据库供应商中已经被过度使用了.

Yes, the word "schema" unfortunately has become overloaded among database vendors.

"SQL-99 完整,真的"说:

SQL 目录是一组命名的模式....

An SQL Catalog is a named group of Schemas. ...

SQL Schema 是一组命名的 SQL 数据,属于特定的.... 每个架构对象都有一个必须唯一的名称(在其名称类的对象中)在它所属的架构中.架构对象名称类是:

An SQL Schema is a named group of SQL-data that is owned by a particular . ... Every Schema Object has a name that must be unique (among Objects of its name class) within the Schema it belongs to. The Schema Object name classes are:

  • 基本表和视图
  • 域和 UDT
  • 约束和断言
  • 字符集
  • 排序规则
  • 翻译
  • 触发器
  • SQL 服务器模块
  • SQL 调用的例程

Oracle 交替使用模式"和用户",这总是让我皱眉.

Oracle uses "schema" and "user" interchangeably, which always makes my eyebrows raise.

MySQL 使用 SCHEMA 作为 DATABASE 的同义词.

MySQL uses SCHEMA as a synonym for DATABASE.

PostgreSQL 使用模式"但使用数据库"来指代标准 SQL 称为目录"的内容.

PostgreSQL uses "schema" but uses "database" to refer to what standard SQL calls a "catalog."

这篇关于数据库模式混乱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆