数据库原理 英文课件Chapter3- The Relational Data Model
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
• DB2, Oracle, Ingres, Sybase, Informix,…
4
3.1 Basic of the Relational Model
The relational model gives us a single way to represent data: as a two- dimensional table called a relation.
6
Schemas(模式)
The name of a relation and the set of attributes for a relation is called the schema for that relation. We show the schema for the relation with the relation name followed by a parenthesized list of its attributes.
555-1235
Pat
123 Main St
555-1235
Harry
456 Main St
555-2221
Sally
456 Main St
555-2221
Sally
456 Main St
555-2223
Pat
12 State St
555-1235
12
More …
Relation (Instance) = a set of tuples Database = collection of relations Relation schema = relation name + attributes
11
An Example of Relation Instance
Relation: Person (Name, Address, Telephone)
Relation Instance:
Name
Address
Telephone
Bob
123 Main St
555-1234
Bob
128 Main St
Example: Movies (title, year, length, fileType)
Database schema = a set of all relation schemas
Movies(Title, Year, Length, FileType) Star(Name, Age) Studio(StudioName, Addr)
Contents
3.1 Basics of the Relational Model 3.3 From E/R diagrams to Relational Designs 3.5 Functional Dependencies 3.7 Design of Relational Database Schemas Reading Guide Exercise
7
Tuples(元组)
The rows of a relation, other than the header row containing the attributes, are called tuple. For example:
Relations, however, are sets of tuples, and it is impossible for a tuple to appear more than once in a given relation.
13
Name Addr Tel
N1 A1 T1
N2 A2 T2
N3 A3 T3
N4
T4
N5
T5
T6
T7
Domai n
Attribute
Name Addr Tel N1 A1 T1 N1 A1 T2 N1 A1 T3 Component
. . .
N1 A1 T7 N1 A2 T1 N1 A3 T1 Tuple N2 A1 T1
3
The things you should know…
The basic principle of relational database is proposed by E.F.Codd in 1970. The first RDBMS production is System R The most popular RDBMS
5
Attributes (属性)
Attributes of a relation serve us as names for the columns of the relation. Usually, the attributes describes the meaning of entries in the column below.
9
EquivLeabharlann Baidulent Representations of a Relation
The attributes of the relation can be reordered without change the relation.
10
Relation Instance(关系实例)
A relation about movies is not static; rather, relations change over time. It is not common for the schema of a relation to change. We shall call a set of tuples for a given relation an instance of that relation.
8
Domains(域)
The relational model requires that each component of each tuple be atomic; that is, it must be of some elementary type such as integers or string. Each attributes of a relation has particular elementary type, thus domain is decided.
4
3.1 Basic of the Relational Model
The relational model gives us a single way to represent data: as a two- dimensional table called a relation.
6
Schemas(模式)
The name of a relation and the set of attributes for a relation is called the schema for that relation. We show the schema for the relation with the relation name followed by a parenthesized list of its attributes.
555-1235
Pat
123 Main St
555-1235
Harry
456 Main St
555-2221
Sally
456 Main St
555-2221
Sally
456 Main St
555-2223
Pat
12 State St
555-1235
12
More …
Relation (Instance) = a set of tuples Database = collection of relations Relation schema = relation name + attributes
11
An Example of Relation Instance
Relation: Person (Name, Address, Telephone)
Relation Instance:
Name
Address
Telephone
Bob
123 Main St
555-1234
Bob
128 Main St
Example: Movies (title, year, length, fileType)
Database schema = a set of all relation schemas
Movies(Title, Year, Length, FileType) Star(Name, Age) Studio(StudioName, Addr)
Contents
3.1 Basics of the Relational Model 3.3 From E/R diagrams to Relational Designs 3.5 Functional Dependencies 3.7 Design of Relational Database Schemas Reading Guide Exercise
7
Tuples(元组)
The rows of a relation, other than the header row containing the attributes, are called tuple. For example:
Relations, however, are sets of tuples, and it is impossible for a tuple to appear more than once in a given relation.
13
Name Addr Tel
N1 A1 T1
N2 A2 T2
N3 A3 T3
N4
T4
N5
T5
T6
T7
Domai n
Attribute
Name Addr Tel N1 A1 T1 N1 A1 T2 N1 A1 T3 Component
. . .
N1 A1 T7 N1 A2 T1 N1 A3 T1 Tuple N2 A1 T1
3
The things you should know…
The basic principle of relational database is proposed by E.F.Codd in 1970. The first RDBMS production is System R The most popular RDBMS
5
Attributes (属性)
Attributes of a relation serve us as names for the columns of the relation. Usually, the attributes describes the meaning of entries in the column below.
9
EquivLeabharlann Baidulent Representations of a Relation
The attributes of the relation can be reordered without change the relation.
10
Relation Instance(关系实例)
A relation about movies is not static; rather, relations change over time. It is not common for the schema of a relation to change. We shall call a set of tuples for a given relation an instance of that relation.
8
Domains(域)
The relational model requires that each component of each tuple be atomic; that is, it must be of some elementary type such as integers or string. Each attributes of a relation has particular elementary type, thus domain is decided.