- Learning PostgreSQL 10(Second Edition)
- Salahaldin Juba Andrey Volkov
- 231字
- 2021-07-02 22:42:03
Attribute
Each attribute has a name and a domain, and the name should be distinct within the relation. The domain defines the possible set of values that the attribute can have. One way to define the domain is to define the data type and a constraint on this data type. For example, hourly wage should be a positive real number and bigger than five if we assume that the minimum hourly wage is five dollars. The domain could be continuous, such as salary, which is any positive real number, or discrete, such as gender.
The formal relational model puts a constraint on the domain: the value should be atomic. Atomic means that each value in the domain is inpisible. For instance, the name attribute domain is not atomic because it can be pided into first name and last name. Some examples of domains are as follows:
- Phone number: Numeric text with a certain length.
- Country code: Defined by ISO 3166 as a list of two letter codes (ISO alpha-2) and three letter codes (ISO alpha-3). The country codes for Germany are DE and DEU for alpha-2 and alpha-3 respectively.
In real-life applications, it is better to use ISO and international standards for lookup tables such as country and currency. This enables you to expose your data much easily for third-party software and increases your data quality.
- 精通MATLAB圖像處理
- 錯(cuò)覺:AI 如何通過數(shù)據(jù)挖掘誤導(dǎo)我們
- 控制與決策系統(tǒng)仿真
- Multimedia Programming with Pure Data
- STM32嵌入式微控制器快速上手
- CompTIA Network+ Certification Guide
- 傳感器與新聞
- Mastering ServiceNow Scripting
- 網(wǎng)站前臺設(shè)計(jì)綜合實(shí)訓(xùn)
- Azure PowerShell Quick Start Guide
- 悟透AutoCAD 2009案例自學(xué)手冊
- Linux嵌入式系統(tǒng)開發(fā)
- Spatial Analytics with ArcGIS
- 電子設(shè)備及系統(tǒng)人機(jī)工程設(shè)計(jì)(第2版)
- Data Analysis with R(Second Edition)