Overview
The goal of a model is to reduce and abstract the real world into something computable.
It is represented as a collection of tables.
Relational Model describe how to operate database with some operations.
A relation is a set, no duplicate tuples.
Tuples are unordered.
Attributes are unordered and are referenced by name and not position.
A super key, SK, is a subset of attributes that uniquely identify a tuple
A super key usually has redundant attributes. A key is a set of attributes with no redundancies that uniquely identifies a tuple.
Relational Model Integrity
Candidate Key-uniquely identify a tuple.
Primary Key - One of the candidate keys.
Alternate Key - other candidate key not primary key.
Foreign Key - in one relation whose value are required to be equal to the primary key of another relation.
Entity
Referential
Relational Algebra
The Relational Algebra is a set of operators that operate on relations, producing other relations.
8 operators:
Selection Operator
used to select a subset of tuples from a single relation that satisfy a selection criterion.
Projection Operator
The projection operator is used to select a subset of attributes(columns) from a single relation.
Hence: projection removes duplicates!
Rename Operator
just a combination of the Projection operator that allows attributes to be renamed.
Product Operator
Union Operator
union compatible relations
Intersection Operator
find the same part of the two tables
Difference Operator
find the difference data of the tables.
Join Operator
a binary operator used to combine tuples from two relations where the tuples are related by some join expression.
Nature join is with the duplicate attributes removed.
Divide Operator
finished
本文概述了关系数据库模型的核心概念,包括关系、元组、属性等基本元素,并详细介绍了超键、候选键、主键及外键的作用。此外,还探讨了关系代数中的八种操作符,如选择、投影、重命名、乘积、并集、交集、差集和连接运算,以及这些操作如何帮助处理数据。
4582

被折叠的 条评论
为什么被折叠?



