DATABASE SYSTEM CONCEPTS

 E-R Model  , abstract , independent of database implementation

 

Requirement  ->  E-R Model  ->  Database Implementation

 

Mapping the meaning of interations of real-world enterprises onto a conceptual schema

Mapping the real-world information and their relationship into E-R Model

 

Entity : An entity has attributes  (a record)

            attribute type : simple and single value

                                    composite(eg. an attribute composed by family_name + last_name)

                                    multivalued(eg. an phone attribute for on person, phone1, phone2)           

                                    Derived(to be calculated from other attribute)

Entity Set : A set of entityes have the same type (a table)

 

A relationship is an association among several entities.

{ (e1, e2, e3) | e1∈E1, e2∈E2, e3∈E3 }, (e1, e2, e3) is a relationship

 

A super-key is a set of one or more attributes that, taken collectively, allow us to identify an entity in the entity set.

A candidate-key is the minmal super-key, there may be many.

 

Aggregation In ER-Model : treat the relationship of several entities as a new entity, and connect it with another entity, That's the resuse of relationship.

 

 

 

 

 

tuple = entity = record

 

 


Storage and File Structure

 

The unit of disk operation is a block, about 512 Bytes

 

* Fixed-Length Records

   When delete an record : mark blank by free link list method , Or, move the bottom record to take the room

 

* Variable-Length Records

   A block contains many records

  | p1  p2  p3 .................free room .........e3, e2, e2 |   the pointer in the front points to the real entity, when an entity is deleted, the entites at the behine in the same block is moved up.

 

 

 

 


Database Index

 

Primary Index : If any, only one. The record in the disk should be stored sequentially according to the index key.

 

Secondary Index : Can be multiple, independent with the record alignment in the disk. It's the index in normal sense.

 

Tree

B Tree :

B- Tree :

B+ Tree :

B* Tree :  

 

 Hash

Static Hash : Normal hash, hash the key to the bucket(disk block)

 

Dynamic Hash : The size of the hash table can be changed, when chang happen, all the data in bucket has to be reorganized to adapt the hash table of new size.

 

Bitmap

The value of a field is limited to several choices, it's used to facilitate the composition query.

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值