Cracking the coding interview--Q15.4
来源:互联网 发布:淘宝全屏主页热点图 编辑:程序博客网 时间:2024/05/16 09:02
题目
原文:
Draw an entity-relationship diagram for a database with companies, people, and professionals (people who work for companies).
译文:
画一个数据库的实体关系图,包含公司(companies),人(people), 专业人士(professionals)。
解答
在公司中工作的人(people)是专业人士(professionals),因此, professionals和people间是ISA(is a)的关系。 或者,我们可以说professionals是从people派生出来的。
除了people的属性,每个professional还有自己额外的属性,如:级别,工作经验等。
一个professional只能去一家公司上班(一般情况下是这样), 而一家公司可以雇佣很多的professional。因此,它们之间是多对一的关系。 “工作(work for)"关系可以有如下属性:加入公司的时间,工资等。 为什么这两个属性是关系的属性而不是professional的属性呢? 因为只有当我们将professional和companies联系起来,才会有这些属性, 或是说这些属性才有意义。
一个人可以有多个电话号码,因此电话号码是一个多值属性。
ER图如下:
转自:http://hawstein.com/posts/15.4.html
---EOF---
0 0
- Cracking the coding interview--Q15.4
- Cracking the coding interview--Q15.1
- Cracking the coding interview--Q15.2
- Cracking the coding interview--Q15.3
- Cracking the coding interview--Q15.5
- Cracking the Coding Interview
- 《Cracking the coding interview》
- Cracking The Coding Interview
- Cracking the coding interview
- Cracking the coding interview
- Cracking the coding interview--Q12.4
- Cracking the Coding Interview Chap1 Q1.4
- Cracking the coding interview--Q1.4
- Cracking the coding interview--Q2.4
- Cracking the coding interview--Q3.4
- Cracking the coding interview--Q1.4
- Cracking the coding interview--Q2.4
- Cracking the coding interview--Q3.4
- 三角形类2
- U-boot详解
- Android TextView属性详解
- astar算法伪代码
- Oracle&SQLServer中实现跨库查询
- Cracking the coding interview--Q15.4
- MySQL中trim()函数的用法
- 07. self指针
- ubuntu12.04添加国内软件源
- 08. 内存管理
- Error: Can't place multiple pins assigned to pin location Pin_114 (IOPAD_X47)
- linux主机配置DNS服务器方法
- UVA 11020 Efficient Solutions(C++STL应用)
- linux每日一餐 - 开篇