- 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.
- 現代測控系統典型應用實例
- 后稀缺:自動化與未來工作
- 現代測控電子技術
- 21天學通PHP
- 手把手教你學AutoCAD 2010
- 數據挖掘實用案例分析
- Visual C# 2008開發技術詳解
- 四向穿梭式自動化密集倉儲系統的設計與控制
- 數據通信與計算機網絡
- 完全掌握AutoCAD 2008中文版:機械篇
- Hands-On Data Warehousing with Azure Data Factory
- MATLAB-Simulink系統仿真超級學習手冊
- Web編程基礎
- SQL Server 2019 Administrator's Guide
- SolarWinds Server & Application Monitor:Deployment and Administration