Article Directory
version
Database system concept
Machinery Industry Press
Sixth edition of the original book, translated edition
Chapter 2: Introduction to the Relational Model
2.1 The structure of a relational database
Relational database is composed of a collection of tables, each table has a unique name
Row of the table represents a set of values between the contact
Since a table is a collection of this connection , the table is closely related to the concept of mathematical relations , which is also the origin of the name of the relational database
In the terminology of the relational model, relations are used to refer to tables , tuples are used to refer to rows , and attributes are used to refer to columns in the table.
Each attribute of the relationship has a set of allowed values , this set is called the domain
Null is a special value, which means that the value is unknown or does not exist
2.2 Database mode
Database mode: the logical design of the
database Database example: a snapshot of the data in the database at a specific moment
For example, the department relationship, the relationship model is:
department (dept_name, building, budget)
2.3 yards
Super key: a collection of one or more attributes, the combination of these attributes can uniquely represent a tuple in the relationship, that
is, uniquely identify a column in the table
Candidate key (candidate key): the smallest super code (super code may contain some irrelevant elements)
Primary key: distinguish in a relationship
Foreign key: The attribute of a relational pattern r1 has the main code of another relational pattern r2. This attribute is called the foreign key of r1 with reference to r2
Referenced relation: r1 is called the referenced relation of the outer code dependence, and r2 is called the referenced relation of the outer code
2.4 Pattern diagram
Book example picture:
2.6 Relational operations
Concatenation operations, Cartesian product operations, etc., will be introduced in subsequent chapters
Relational Algebra: Introduction in Chapter 6
2.7 Summary
The meaning of a few keywords:
Relational data model, pattern, super code, candidate code, main code, outer code, pattern graph, relational algebra
On the whole, the second chapter is mainly about the understanding of the concept. It is not difficult. It is enough to understand the concept clearly.