关系数据库: 基本术语

Relational Databases: Basic Terms
关系数据库: 基本术语
The relational database model uses certain terms to describe its components:
关系数据库模型使用某些术语来描述其组件:
Data are the values kept in the database. On their own, the data means very little. CA 684-213 is an example of data in a DMV (Division of Motor Vehicles) database.
● 数据是保存在数据库中的值。就他们自己而言,数据意义很小。CA 684-213是DMV (机动车部门) 数据库中的数据示例。
Information is processed data. For example, CA 684-213 is the car registration number of a car belonging to Lyndon Manson, in a DMV database.
● 信息是处理数据。例如,在DMV数据库中,CA 684-213是属于Lyndon Manson的汽车注册号。
A database is a collection of tables, also called entities.
● 数据库是表的集合,也称为实体。
Each table is made up of records (the horizontal rows in the table, also called tuples). Each record should be unique, and can be stored in any order in the table.
● 每个表由记录 (表中的水平行,也称为元组) 组成。每个记录应该是唯一的,并且可以以任何顺序存储在表中。
Each record is made up of fields (which are the vertical columns of the table, also called attributes). Basically, a record is one fact (for example, one customer or one sale).
● 每个记录由字段 (即表的垂直列,也称为属性) 组成。基本上,记录是一个事实 (例如,一个客户或一次销售)。
These fields can be of various types. MariaDB has many types (see Data Types for a list), but generally types fall into three kinds: character, numeric, and date. For example, a customer name is a character field, a customer's birthday is a date field, and a customer's number of children is a numeric field.
● 这些字段可以是各种类型。MariaDB有许多类型 (请参阅列表中的数据类型),但类型通常分为三种: 字符、数字和日期。例如,客户名称是字符字段,客户的生日是日期字段,客户的孩子数量是数字字段。
The range of allowed values for a field is called the domain (also called a field specification). For example, a credit card field may be limited to only the values Mastercard, Visa and Amex.
● 字段的允许值范围称为域 (也称为字段规范)。例如,信用卡字段可能仅限于万事达卡、维萨卡和美国运通的值。
A field is said to contain a null value when it contains nothing at all. Null fields can create complexities in calculations and have consequences for data accuracy. For this reason, many fields are specifically set not to contain null values.
● 当字段不包含任何内容时,它被称为包含null值。空字段会在计算中产生复杂性,并对数据准确性产生影响。因此,许多字段被专门设置为不包含null值。
A key accesses specific records in a table.
● 键访问表中的特定记录。
An index is a mechanism to improve the performance of a database. Indexes are often confused with keys. Indexes are, strictly speaking, part of the physical structure, and keys are part of the logical structure. You'll often see the terms used interchangeably, however, including throughout this Knowledge Base.
● 索引是一种提高数据库性能的机制。索引经常与键混淆。严格来说,索引是物理结构的一部分,而键是逻辑的一部分。然而,你会经常看到这些术语可以互换使用,包括在整个知识库中。
A view is a virtual table made up of a subset of the actual tables.
● 视图是由实际表的子集组成的虚拟表。
A one-to-one (1:1) relationship is where for each instance of the first table in a relationship, only one instance of the second table exists, An example of this would be a case where a chain of stores carries a vending machine. Each vending machine can only be in one store, and each store carries only one vending machine.
● 一对一 (1:1) 关系是,对于关系中第一个表的每个实例,仅存在第二个表的一个实例,这方面的一个例子是连锁商店携带自动售货机。每个自动售货机只能在一个商店中,并且每个商店仅携带一台自动售货机。

image

A one-to-many (1:N) relationship is where for each instance of the first table in a relationship, many instances of the second table exist. This is a common kind of relationship. An example is the relationship between a sculptor and their sculptures. Each sculptor may have created many sculptures, but each sculpture has been created by only one sculptor.
● 一对多 (1:N) 关系是指对于关系中的第一个表的每个实例,存在第二个表的许多实例。这是一种常见的关系。一个例子是雕塑家和他们的雕塑之间的关系。每个雕塑家可能创作了许多雕塑,但每个雕塑仅由一位雕塑家创作。

image

A many-to-many (M:N) relationship occurs where, for each instance of the first table, there are many instances of the second table, and for each instance of the second table, there are many instances of the first. For example, a student can have many lecturers, and a lecturer can have many students.
● 发生多对多 (M:N) 关系,其中对于第一个表的每个实例,都有第二个表的许多实例,对于第二个表的每个实例,都有许多第一个表的实例。例如,一个学生可以有许多讲师,而一个讲师可以有许多学生。

A mandatory relationship exists where for each instance of the first table in a relationship, one or more instances of the second must exist. For example, for a music group to exist, there must exist at least one musician in that group.
● 存在强制关系,其中对于关系中第一个表的每个实例,必须存在第二个表的一个或多个实例。例如,要使一个音乐团体存在,该团体中必须至少存在一名音乐家。
An optional relationship is where for each instance of the first table in a relationship, there may exist instances of the second. For example, if an author can be listed in the database without having written a book (in other words, a prospective author), that relationship is optional. The reverse isn't necessarily true though. For example, for a book to be listed, it must have an author.
● 可选关系是,对于关系中第一个表的每个实例,可能存在第二个表的实例。例如,如果一个作者可以在没有写书的情况下被列在数据库中 (换句话说,是一个未来的作者),这种关系是可选的。然而,相反的情况不一定是真的。例如,要列出一本书,它必须有一个作者。
Data integrity refers to the condition where data is accurate, valid, and consistent. An example of poor integrity would be if a customer telephone number is stored differently in two different locations. Another is where a course record contains a reference to a lecturer who is no longer present at the school. Database normalization is a technique that assists you to minimize the risk of these sorts of problems.
● 数据完整性是指数据准确、有效和一致的条件。完整性差的一个例子是,如果客户电话号码在两个不同的位置以不同的方式存储。另一个是课程记录包含对不在学校的讲师的引用。数据库规范化是一种帮助您将此类问题的风险降至最低的技术。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 216,039评论 6 498
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,223评论 3 392
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 161,916评论 0 351
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,009评论 1 291
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,030评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,011评论 1 295
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,934评论 3 416
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,754评论 0 271
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,202评论 1 309
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,433评论 2 331
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,590评论 1 346
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,321评论 5 342
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,917评论 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,568评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,738评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,583评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,482评论 2 352

推荐阅读更多精彩内容