这可能是一个非常糟糕的问题。但我一直将模式视为数据库中的表定义。这是错误的或不完全正确的。我不太记得我的数据库课程了。
当前回答
As https://www.informit.com/articles/article.aspx?p=30669
所有对象的名称在一定范围内必须是唯一的。每一个 数据库必须有唯一的名称;模式名称不能重复 在单个数据库的范围内,表的名称必须为 在单个模式的作用域中是唯一的,列名必须是 在表中是唯一的。类中索引的名称必须唯一 数据库。
其他回答
简而言之,模式是整个数据库的定义,因此它包括表、视图、存储过程、索引、主键和外键等。
As https://www.informit.com/articles/article.aspx?p=30669
所有对象的名称在一定范围内必须是唯一的。每一个 数据库必须有唯一的名称;模式名称不能重复 在单个数据库的范围内,表的名称必须为 在单个模式的作用域中是唯一的,列名必须是 在表中是唯一的。类中索引的名称必须唯一 数据库。
模式是数据库对象的集合,其中也包括逻辑结构。 它具有拥有它的用户的名称。 一个数据库可以有任意数量的Schema。 数据库中的一个表可以出现在两个同名的不同模式中。 用户可以查看已为其分配选择特权的任何模式。
来自PostgreSQL文档:
A database contains one or more named schemas, which in turn contain tables. Schemas also contain other kinds of named objects, including data types, functions, and operators. The same object name can be used in different schemas without conflict; for example, both schema1 and myschema can contain tables named mytable. Unlike databases, schemas are not rigidly separated: a user can access objects in any of the schemas in the database he is connected to, if he has privileges to do so. There are several reasons why one might want to use schemas: To allow many users to use one database without interfering with each other. To organize database objects into logical groups to make them more manageable. Third-party applications can be put into separate schemas so they do not collide with the names of other objects. Schemas are analogous to directories at the operating system level, except that schemas cannot be nested.
数据库模式是对表、视图、存储过程等对象进行逻辑分组的一种方式。把模式看作是对象的容器。 表是行和列的集合。 所有表的组合构成一个db。
推荐文章
- 获得PostgreSQL数据库中当前连接数的正确查询
- MySQL数据库表中的最大记录数
- 从现有模式生成表关系图(SQL Server)
- HyperLogLog算法是如何工作的?
- 数据库和模式的区别
- 如何从命令行在windows中找到mysql数据目录
- 如何找到MySQL的根密码
- 将表从一个数据库复制到另一个数据库的最简单方法?
- 截断Postgres数据库中的所有表
- 什么是分片,为什么它很重要?
- 数据库触发器是必要的吗?
- 为什么我应该使用基于文档的数据库而不是关系数据库?
- 哪个更快/最好?SELECT *或SELECT columnn1, colum2, column3等
- 将值从同一表中的一列复制到另一列
- 什么是数据库池?