- Learning PostgreSQL 10(Second Edition)
- Salahaldin Juba Andrey Volkov
- 315字
- 2021-07-02 22:42:02
Relation
Think of a relation as a table with a header, columns, and rows. The table name and the header help in interpreting the data in the rows. Each row represents a group of related data, which points to a certain object.
A relation is represented by a set of tuples. Tuples should have the same set of ordered attributes. Attributes have a domain, that is, a type and a name:

The relation schema is denoted by the relation name and the relation attributes. For example, customer (customer_id, first_name, last_name, and email) is the relation schema for the customer relation. Relation state is defined by the set of relation tuples; thus, adding, deleting, and amending a tuple will change the relation to another state.
Tuple order or position in the relation is not important, and the relation is not sensitive to tuple order. The tuples in the relation could be ordered by a single attribute or a set of attributes. Also, a relation cannot have duplicate tuples.
A relation can represent entities in the real world, such as a customer, or can be used to represent an association between relations. For example, the customer could have several services and a service can be offered to several customers. This could be modeled by three relations: customer, service, and customer_service. The customer_service relation associates the customer and the service relations. Separating the data in different relations is a key concept in relational database modeling, which is called normalization. Normalization is the process of organizing relation columns and relations to reduce data redundancy. For example, assume that a collection of services is stored in the customer relation. If a service is assigned to multiple customers, this would result in data redundancy. Also, updating a certain service would require updating all its copies in the customer table.
- 大數(shù)據(jù)項目管理:從規(guī)劃到實現(xiàn)
- PostgreSQL 11 Server Side Programming Quick Start Guide
- Circos Data Visualization How-to
- Mobile DevOps
- 機器人智能運動規(guī)劃技術(shù)
- Apache Hive Essentials
- 大數(shù)據(jù)技術(shù)入門(第2版)
- 精通Excel VBA
- Mastering Elastic Stack
- JSF2和RichFaces4使用指南
- 在實戰(zhàn)中成長:Windows Forms開發(fā)之路
- Cloud Security Automation
- 在實戰(zhàn)中成長:C++開發(fā)之路
- 空間機器人
- PowerPoint 2010幻燈片制作高手速成