Don’t get discouraged if it is taking a lttle longer than you expected. The more time it will take the better performance it will give. Don’t think that you will never achieve your goal or you will never get you want. Failure might cause your goals a lttle delay but it doesn’t mean that you will never achieve them. It simply means that it will take just lttle longer. When Beethoven was young, everybody used to tell him that he has no talent for music. He knew that he will be the best composer after a considerable time. Today everyone knows that he gave the world some of the best music.
THE TOUCHSTONE
The day streched into weeks and the weeks into the months.One day, however,about midafternoon, he picked up a pebble and it was warm. He threw it into the sea before he had done. He had formed such a strong habit of throwing each pebble into sea that when the one he wanted came along he still it away.
So it is with opportunity. Unless we are vigilant it’s easy to fail to recongnize an opportunity when it is in hand and just as easy to throw it away.
数据库设计
一、数据库设计数据库的流程
一.数据设计流程模型
1.现实世界的实体模型通过建模转换为信息世界的概念模型(即E-R模型)
2.概念模型经过模型转化,得到数据库世界使用的数据模型(在关系数据库设计中为关系模型)
3.数据库模型进一步规范化,得到数据库结构模型
1. E-R(entity-)模型图
1.1 E-R图的组成要素:
• 实体(entity)显示世界客观存在,并区别于其他对象的“事件”或“物体”
• 属性(attribute)每个实体的特征
• 主键(key) 能唯一区分实体的属性
• 联系(relationship)实体与实体之间的联系,有1:1,1:n,m:n
2 E-R图转换到关系模式:
对于E-R图中每个实体,都应转换为一个关系
该关系应包括
◇ 对应实体的全部属性,
◇ 并应根据关系所表达的语义确定哪个属性或哪几个属性组作为“关键字”,关键字用下划线标识。
2.1 关系模型中常用的概念:
◇ 关系:可以理解为一张二维表,每个关系都具有一个关系名,就是通常说的表名
◇ 元组:可以理解为二维表中的一行,在数据库中经常被称为记录
◇ 属性:可以理解为二维表中的一列,在数据库中经常被称为字段
◇ 域:属性的取值范围,也就是数据库中某一列的取值限制
◇ 关键字:一组可以唯一标识元祖的属性,数据库中常称为主键,由一个或多个列组成
◇ 关键模式:指对关系的描述。其格式为:关系名(属性1,属性2,… …,属性N),在数据库中成为表结构主键用下划线标出
2.2 E-R图转换到关系模式
1) 1:1联系
2) (1:n联系)
3) E-R图转换到关系模式(m:n联系)
3. 数据库设计规范化,得到数据结构模型
1)第一范式(1nd NF)
1. 第一范式的目标是确保每列的原子性
2. 如果每列都是不可再分的最小数据单元(最小的原子单元),则满足第一范式。
2)第二范式
1. 如果一个关系满足1NF,并且出任何一个非主键字段的数据都要依赖于主键字段,则满足第二范式(2NF)
2. 第二范式要求每个表只描述一件事情
3)第三范式(3rd NF)
1. 若一个关系满足第一范式(1NF)和第二范式(2NF),任何两个非主键字段的数值之间不存在函数依赖关系,则满足第三范式(3NF)。
The Split Milk Story – Learn from your mistakes
whenever you make a mess like this, eventually you have clean it upend restore everything to its proper order