这可能是一个非常糟糕的问题。但我一直将模式视为数据库中的表定义。这是错误的或不完全正确的。我不太记得我的数据库课程了。


当前回答

关系模式是表的逻辑定义——它定义了表的名称,以及每一列的名称和类型。就像一个计划或蓝图。数据库模式是整个数据库的关系模式的集合。

表是由一组行(又名“元组”)组成的结构,每一行都有由模式定义的属性。表上还可能有索引,以帮助查找某些列上的值。

从形式上讲,数据库是任何数据的集合。在这个上下文中,数据库将是表的集合。DBMS(数据库管理系统)是管理和运行数据库的软件(如MySQL, SQL Server, Oracle等)。

其他回答

As https://www.informit.com/articles/article.aspx?p=30669

所有对象的名称在一定范围内必须是唯一的。每一个 数据库必须有唯一的名称;模式名称不能重复 在单个数据库的范围内,表的名称必须为 在单个模式的作用域中是唯一的,列名必须是 在表中是唯一的。类中索引的名称必须唯一 数据库。

就像MusiGenesis说的那样,在大多数数据库中:

架构:数据库:表::平面图:房子:房间

但是,在Oracle中,它可能更容易想到:

架构:数据库:表::所有者:房子:房间

我试着根据我对以下类比的理解来回答:

A database is like the house In the house there are several types of rooms. Assuming that you're living in a really big house. You really don't want your living rooms, bedrooms, bathrooms, mezzanines, treehouses, etc. to look the same. They each need a blueprint to tell how to build/use them. In other words, they each need a schema to tell how to build/use a bathroom, for example. Of course, you may have several bedrooms, each looks slightly different. You and your wife/husband's bedroom is slightly different from your kids' bedroom. Each bedroom is analogous to a table in your database. A DBMS is like a butler in the house. He manages literally everything.

在oracle中,Schema是一个数据库下的一个用户,例如scott是orcl数据库中的一个模式。 在一个数据库中,我们可能有很多像scott这样的模式

架构->平面图

数据库->房子

桌子->房间