關(guān)系數(shù)據(jù)庫: 基本術(shù)語

Relational Databases: Basic Terms
關(guān)系數(shù)據(jù)庫: 基本術(shù)語
The relational database model uses certain terms to describe its components:
關(guān)系數(shù)據(jù)庫模型使用某些術(shù)語來描述其組件:
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.
● 數(shù)據(jù)是保存在數(shù)據(jù)庫中的值。就他們自己而言,數(shù)據(jù)意義很小。CA 684-213是DMV (機動車部門) 數(shù)據(jù)庫中的數(shù)據(jù)示例。
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.
● 信息是處理數(shù)據(jù)。例如,在DMV數(shù)據(jù)庫中,CA 684-213是屬于Lyndon Manson的汽車注冊號。
A database is a collection of tables, also called entities.
● 數(shù)據(jù)庫是表的集合,也稱為實體。
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.
● 每個表由記錄 (表中的水平行,也稱為元組) 組成。每個記錄應(yīng)該是唯一的,并且可以以任何順序存儲在表中。
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有許多類型 (請參閱列表中的數(shù)據(jù)類型),但類型通常分為三種: 字符、數(shù)字和日期。例如,客戶名稱是字符字段,客戶的生日是日期字段,客戶的孩子數(shù)量是數(shù)字字段。
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.
● 字段的允許值范圍稱為域 (也稱為字段規(guī)范)。例如,信用卡字段可能僅限于萬事達卡、維薩卡和美國運通的值。
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.
● 當(dāng)字段不包含任何內(nèi)容時,它被稱為包含null值。空字段會在計算中產(chǎn)生復(fù)雜性,并對數(shù)據(jù)準(zhǔn)確性產(chǎn)生影響。因此,許多字段被專門設(shè)置為不包含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.
● 索引是一種提高數(shù)據(jù)庫性能的機制。索引經(jīng)常與鍵混淆。嚴(yán)格來說,索引是物理結(jié)構(gòu)的一部分,而鍵是邏輯的一部分。然而,你會經(jīng)常看到這些術(shù)語可以互換使用,包括在整個知識庫中。
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) 關(guān)系是,對于關(guān)系中第一個表的每個實例,僅存在第二個表的一個實例,這方面的一個例子是連鎖商店攜帶自動售貨機。每個自動售貨機只能在一個商店中,并且每個商店僅攜帶一臺自動售貨機。

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) 關(guān)系是指對于關(guān)系中的第一個表的每個實例,存在第二個表的許多實例。這是一種常見的關(guān)系。一個例子是雕塑家和他們的雕塑之間的關(guān)系。每個雕塑家可能創(chuàng)作了許多雕塑,但每個雕塑僅由一位雕塑家創(chuàng)作。

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.
● 發(fā)生多對多 (M:N) 關(guān)系,其中對于第一個表的每個實例,都有第二個表的許多實例,對于第二個表的每個實例,都有許多第一個表的實例。例如,一個學(xué)生可以有許多講師,而一個講師可以有許多學(xué)生。

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.
● 存在強制關(guān)系,其中對于關(guān)系中第一個表的每個實例,必須存在第二個表的一個或多個實例。例如,要使一個音樂團體存在,該團體中必須至少存在一名音樂家。
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.
● 可選關(guān)系是,對于關(guān)系中第一個表的每個實例,可能存在第二個表的實例。例如,如果一個作者可以在沒有寫書的情況下被列在數(shù)據(jù)庫中 (換句話說,是一個未來的作者),這種關(guān)系是可選的。然而,相反的情況不一定是真的。例如,要列出一本書,它必須有一個作者。
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.
● 數(shù)據(jù)完整性是指數(shù)據(jù)準(zhǔn)確、有效和一致的條件。完整性差的一個例子是,如果客戶電話號碼在兩個不同的位置以不同的方式存儲。另一個是課程記錄包含對不在學(xué)校的講師的引用。數(shù)據(jù)庫規(guī)范化是一種幫助您將此類問題的風(fēng)險降至最低的技術(shù)。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容