Database System Concepts (1) -- Data Models

来源:互联网 发布:查电视盒mac 编辑:程序博客网 时间:2024/05/17 21:41
Data Models
    Entity-Relationship Model
       Entity

       Attribute
          Simple Attribute
          Composite Attribute
          Single valued and Multivalued Attribute
          Derived Attribute: The value of derived attributes can be derived from the values of other related attributes or entities.

       Relationship
          Mapping Cardinalities
             One to One
             One to Many
             Many to One
             Many to Many
          Participation Constraint
             Total relationship: Every entity in entity set E participates in at least one relationship in relationship set R.
             Partial relationship: Only some entities in entity set E participate in the relationships in relationship set R.

          Key
             Super Key: a set of one or more attributes that, taken collectively, allow us to identify uniquely an entity in the entity set.
             Candidate Key: minimal super key
             Primary Key: a candidate key that is chosen by the database designer as the principal means of identifying entities within an entity set.

          Placement of Relationship Attributes
             Attributes of a one-to-one relationship set can be associated with either one of the participated entities.
             Attributes of a one-to-many relationship set can be repositioned to only the entity set on the "many" side.

          Entity-Relationship Diagram
             Rectangles: Entity sets
             Ellipses: Attributes
             Diamonds: relationship sets
             Lines: link attributes to entity sets and entity sets to relationship sets
             Double Ellipses: Multivalued attributes
             Dashed Ellipses: Derived attributes
             Double Lines: indicate total participation of an entity in a relationship set
             Double Rectangles: Weak entity sets

          Weak Entity Set: An entity set which don't have sufficient attributes to form a primary key.

   
       Relational Model
          Basic Structure
             Table - Relation
             Row - Tuple
          Database Schema:
             Database Schema (Relation Schema): the logical design of the database(relation)
             Database Instance (Relation Instance): a snapshot of the data in the database(relation) at a given instant in time.
          Keys
             Foreign Key: the key of another relation schema
          Schema Diagram
          Query Languages
             Procedural language
             Nonprecedural language

          Relational Algebra
             Select σ
             Project Π
             Union ∪
             Set Difference -
             Cartesian Product ╳
             Rename
             Assignment
             Set Intersection
             Natural Join
             Division
             Generalized Projection: extends the projection operation by allowing arithmetic functions to be used in the projection list
             Aggregate Functions
             Outer Join
                Left Outer Join
                Right Outer Join
                Full Outer Join

          View: any relation that is not part of the logical model, but is mage visible to a user as a virtual relation.
         
          Tuple Relational Calculus
          Domain Relational Caculus
            
            
         
原创粉丝点击