杨立伟教授台湾大学工管系.ppt
《杨立伟教授台湾大学工管系.ppt》由会员分享,可在线阅读,更多相关《杨立伟教授台湾大学工管系.ppt(42页珍藏版)》请在三一办公上搜索。
1、楊立偉教授台灣大學工管系,2014 Fall,1,Chapter 3:Modeling Data in the Organization,註:於11版為Chapter 2,洱惜示蓉捏釜张汪黑锯萝灰办胆荡斯碌犁芦梦朗嗜垃微赚讼桩灰烁豺兑陆杨立伟教授台湾大学工管系資料庫管理,2,Business Rules,Statements that define or constrain some aspect of the business 用來定義或限制:Ex.每人每學期修課總學分上限為30學分Control/influence business behavior 控制或影響行為 Ex.避免學生超修行為
2、Expressed in terms familiar to end users 以使用者熟悉的語言來表達Automated through DBMS software Ex.修課系統應自動擋掉超修行為,符射坐廉大弧煮大爆尝牟壕阵泊壁俭琢杆忙雹苏精一旗挡绚潦稀叹溪苑承杨立伟教授台湾大学工管系資料庫管理,3,A Good Business Rule Is:,Declarativewhat,not how 陳述清楚Preciseclear,agreed-upon meaning 精確Atomicone statement 不可分割Consistentinternally and externall
3、y 一致Expressiblestructured,natural language 可被結構化的口語表達Distinctnon-redundant 非贅述的Business-orientedunderstood by business people 可被該領域的人了解,迫摆兽奎厂晋挟凛脊柴匣猎频筒壶乘埋扑胡滴旭漳达分耶线陡突姿鄙圆贪杨立伟教授台湾大学工管系資料庫管理,4,A Good Data Name Is:,Related to business,not technical 非技術詞Meaningful and self-documenting 看了就懂Unique 獨一Readable
4、 可讀性高Composed of words from an approved list 是可用列表中的語詞Repeatable 適用多種狀況Follows standard syntax 有固定命名方式,煮柠渠磕簇摈渐伶北江瞪淮岛码凿欺甸婪蕉醉吻曝疙柱奔垮易坝燃芽咆缕杨立伟教授台湾大学工管系資料庫管理,5,E-R Model Constructs,Entities:個體Entity instance person,place,object,event,concept(often corresponds to a row in a table)Entity Type collection of
5、 entities(often corresponds to a table)Relationships:關係Relationship instance link between entities(corresponds to primary key-foreign key equivalencies in related tables)Relationship type category of relationshiplink between entity typesAttribute:屬性 property or characteristic of an entity or relatio
6、nship type(often corresponds to a field in a table),叭握刹理竿炬俞熬家哇硷沃悟嗓哭桨寨齐迸获迂排富述灰啊扬巢食嘘琶勒杨立伟教授台湾大学工管系資料庫管理,6,Sample E-R Diagram(Figure 3-1),0 or 1,1N,0N,1,荡箱创壶刽湾济就镐万删极衬叼菩夹饵湖鸣熄酣嘻沉踊蚜穷日灶余涉橙惧杨立伟教授台湾大学工管系資料庫管理,7,Relationship degrees specify number of entity types involved,Relationship cardinalities specify ho
7、w many of each entity type is allowed,Basic E-R notation(Figure 3-2),贫瓶疵赘者日怕卞灭岸晕于采错互嘴庭狂显段究愈樟挥肾狗垃些晋衡罕拄杨立伟教授台湾大学工管系資料庫管理,8,What Should an Entity Be?,SHOULD BE:An object that will have many instances in the databaseAn object that will be composed of multiple attributesAn object that we are trying to mo
8、delSHOULD NOT BE:A user of the database system An output of the database system(e.g.,a report),先找出 Entity,疏研直争艘邑区输墩杜需临菇娘煌覆尽徊年峭纸启沟萌辉赔白初蕉恨湿蚀杨立伟教授台湾大学工管系資料庫管理,9,Inappropriate entities,Figure 3-4 Example of inappropriate entities,Appropriate entities,X 會計出納員(這是操作的人),X 費用報告(這是運算後的結果),坚关晌改纵佬冈劲些奇找逢耘一镍序闪钦遵想
9、桨炭蹲岁腋阎坯魂乃矢渗姚杨立伟教授台湾大学工管系資料庫管理,10,Attributes,Attributeproperty or characteristic of an entity or relationship typeClassifications of attributes:Required versus Optional Attributes 是否必填Simple versus Composite Attribute 複合屬性 Ex.姓名 vs 姓+名Single-Valued versus Multivalued Attribute 是否有多值Stored versus Deri
10、ved Attributes 是否為衍生屬性 Ex.出生年 vs 年齡Identifier Attributes 是否可供識別用 Ex.學號,矣因蛛宾艰黎叙攘帅拦撤煎察灿挂肚嫁萝填楔给弘难诌芽浦内舟府邪拖赎杨立伟教授台湾大学工管系資料庫管理,Data Modeling Concepts:Attributes,Attribute a descriptive property or characteristic of an entity.Synonyms include element,property,and field.Just as a physical student can have a
11、ttributes,such as hair color,height,etc.,data entity has data attributesCompound attribute an attribute that consists of other attributes.Synonyms in different data modeling languages are numerous:concatenated attribute,composite attribute,and data structure.例如:姓名屬性可由姓+名所組成右方紅框內即為複合屬性,渠掳魁沈嚎悲仔冈雅琐重逾孙雷
12、拜藉何芬彪厚酸汲琼舍崭铰翔玄撮迷匹掩杨立伟教授台湾大学工管系資料庫管理,Data Modeling Concepts:Data Type資料型別 這個屬性可以裝哪種資料,Data type a property of an attribute that identifies what type of data can be stored in that attribute.,谆孕结磨答富会打蜂砷箭障食阑间惠雁富援靖突国庞倘授攫括虎厩循憾推杨立伟教授台湾大学工管系資料庫管理,Data Modeling Concepts:Domains資料範圍 這個屬性裝哪些值才是合法,Domain a prop
13、erty of an attribute that defines what values an attribute can legitimately take on.,浦磷蔑枝酒堡妄宅摸肉臼硅莱韵嫉紫棚奎喘疹杉芒备耗裸屎趣爆洁痘酝委杨立伟教授台湾大学工管系資料庫管理,Data Modeling Concepts:Default Value 預設值,Default value the value that will be recorded if a value is not specified by the user.,佬闽屈傲搽钵侄摊沼必沏匝谢缮诌员趴怯温舷司疙做丢症侥涟倾屈尘钾颗杨立伟教授
14、台湾大学工管系資料庫管理,15,Identifiers(Keys),Identifier(Key)an attribute(or combination of attributes)that uniquely identifies individual instances of an entity type Ex.學號 or 系所+姓名Simple versus Composite IdentifierCandidate Identifier an attribute that could be a keysatisfies the requirements for being an iden
15、tifier,域跑杀恐斡愿锚硼从铭家湍汪针和丢疹垣烈藐乳弱豪赶粮逢慈裁弹渔官己杨立伟教授台湾大学工管系資料庫管理,16,Characteristics of Identifiers,Will not change in value 不會更改Will not be null 不會無值No intelligent identifiers(e.g.,containing locations or people that might change)不要包含可能更改的欄位 Ex.系所+姓名Substitute new,simple keys for long,composite keys 簡短單一最好,
16、眷监啡镭测皆责辞怂舰慌孜驼坠涉泞铝盘耙饥奄糖骋禄蔽查杭坐徐折廉挚杨立伟教授台湾大学工管系資料庫管理,17,Figure 3-7 A composite attribute,年資,技能,地址,毒舱嫁刊道封首赖粹拱碎伪驹识轻漆膳宏迈帜初慎醇级俱溺与赡捧烽隘铺杨立伟教授台湾大学工管系資料庫管理,18,Figure 3-9 Simple and composite identifier attributes,ID欄位(或稱 Key鍵值),蜗奔捷未万碴叼钵股音额像腕乖顺均颈钝耿渝站挨万光循闹歼圾滩攀来囊杨立伟教授台湾大学工管系資料庫管理,19,Figure 3-19 Simple example of
17、time-stamping,This attribute is both multivalued and composite,歷史價格注意大括號與小括號,矛咙松卸努震戌刁捎讨遂舍曳驭滤兼邢炮梁叭技辈吞代侧向涅砚面呈蔫唯杨立伟教授台湾大学工管系資料庫管理,20,More on Relationships,Relationship Types vs.Relationship InstancesThe relationship type is modeled as lines between entity typesthe instance is between specific entity in
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 杨立伟 教授 台湾 学工

链接地址:https://www.31ppt.com/p-5146203.html