YouTube2Text

Entity-Relationship Model/3 — Transcript

by Data Base Management System - IITKGP · 4,755 words · 922 segments · language en · Watch on YouTube

Full transcript

  1. 0:00[Music]
  2. 0:16welcome to
  3. 0:17module 15
  4. 0:18of database management systems
  5. 0:22we have been discussing about entity
  6. 0:24relationship model
  7. 0:27and this is the third
  8. 0:29and the closing module on this topic
  9. 0:36so in the last module we have discussed
  10. 0:38about er diagram and we have also seen
  11. 0:41how er model can be converted
  12. 0:44to a relational schema
  13. 0:48in this module we will try to
  14. 0:51go through
  15. 0:53a few extended features of er model try
  16. 0:57to show some of the
  17. 1:00more complicated situations how they can
  18. 1:02be modeled in the er model and along
  19. 1:05with that
  20. 1:07we will discuss a variety of design
  21. 1:10issues
  22. 1:11that will follow
  23. 1:13so these are the
  24. 1:14outline
  25. 1:17so we start with extended
  26. 1:20entity relationship features
  27. 1:23the first that we note is so far
  28. 1:26in the
  29. 1:27entity relationship model
  30. 1:30we have talked about relationships
  31. 1:32between two entity sets
  32. 1:36so we have talked about the student
  33. 1:38attending courses or instructors
  34. 1:40advising students and so on
  35. 1:43so such relationships are naturally
  36. 1:45called binary
  37. 1:47but it is possible that
  38. 1:50more than two entity sets let us say
  39. 1:52three entity sets could be involved in
  40. 1:56the same relation and we show an example
  41. 1:58here
  42. 2:00where
  43. 2:00we have three entity sets instructor
  44. 2:04student
  45. 2:05and project
  46. 2:07so the project entity set
  47. 2:09is a list of projects
  48. 2:11being done by the students or to be done
  49. 2:14by the students
  50. 2:16so the relationship project guide
  51. 2:20is a relationship between
  52. 2:23the guide who is an instructor
  53. 2:25the student
  54. 2:26who will do the project and
  55. 2:29the project that has to be performed so
  56. 2:32all three together define this
  57. 2:34relationship
  58. 2:37so
  59. 2:38in
  60. 2:39such cases
  61. 2:41it is
  62. 2:42possible
  63. 2:43in er model that we can represent it
  64. 2:46conveniently
  65. 2:47as a
  66. 2:48non-binary relationship
  67. 2:52now
  68. 2:54this is in ear diagram this is called a
  69. 2:56ternary relationship
  70. 3:00now
  71. 3:01we have talked about
  72. 3:02cardinality constraints on binary
  73. 3:06relationship one to one many to one
  74. 3:08one to many
  75. 3:10and many too many
  76. 3:11and
  77. 3:13we specified that
  78. 3:15if we have a binary relationship say
  79. 3:18this is one entity set and this is
  80. 3:20another entity set and we have a
  81. 3:22relationship so if we just
  82. 3:25connect them it means a many to many
  83. 3:27relation
  84. 3:28but if we have an arrow on
  85. 3:31one side
  86. 3:33entity set then it means on the arrow
  87. 3:35side is one
  88. 3:37so
  89. 3:38this is ah from
  90. 3:40entity set e one to e two this is one
  91. 3:44too many we could have arrow at both
  92. 3:46ends and that means one to one
  93. 3:49now the question is ah how will that ah
  94. 3:52work out what will be the meaning of
  95. 3:54arrow in terms of a
  96. 3:56ternary relationship
  97. 3:58now in the case of ternary relationship
  98. 4:02or this would generalize to
  99. 4:04relationships of higher degree whether
  100. 4:06where more than three entity sets may be
  101. 4:08involved
  102. 4:10we put a restriction that we will allow
  103. 4:13at most one
  104. 4:14arrow out
  105. 4:17of the ternary relationship
  106. 4:19so we could
  107. 4:20have only if we if we look at
  108. 4:24if we look at
  109. 4:26say this relationship
  110. 4:28then we could have an arrow only at this
  111. 4:31end
  112. 4:33but multiple arrows are not allowed and
  113. 4:36the reason is certainly to keep the
  114. 4:39semantics of the
  115. 4:42cardinality meaningful for example ah
  116. 4:46if we have
  117. 4:47a ternary relationship between a b and c
  118. 4:51lets say this is a a
  119. 4:54this is a b
  120. 4:56and this is c
  121. 4:58and we have a ternary relationship
  122. 5:00between
  123. 5:01them
  124. 5:02and let us say
  125. 5:04if we have
  126. 5:06a
  127. 5:08more than one arrow
  128. 5:10the for example ah suppose
  129. 5:13then
  130. 5:16we have say an arrow to b and an arrow
  131. 5:18to c the question is how should we
  132. 5:20interpret that should we interpret that
  133. 5:24an entity of entities at a
  134. 5:27is associated with
  135. 5:29unique entity from b
  136. 5:32and c
  137. 5:33together or
  138. 5:35should we associate should we interpret
  139. 5:38that the entities
  140. 5:41formed by the pair a b
  141. 5:44and
  142. 5:45the entity formed by the pair ac are
  143. 5:48uniquely related
  144. 5:50so there is multiplicity of
  145. 5:52interpretation if we allow more than one
  146. 5:55arrow in case of a ternary or higher
  147. 5:58degree relationship
  148. 5:59so what will follow for simplicity
  149. 6:02in this course and that is what is
  150. 6:04followed often in practice is in case of
  151. 6:07a ternary or higher order relationship
  152. 6:10only one arrow will be allowed in that
  153. 6:13in a
  154. 6:14in that relationship
  155. 6:18now let us talk about ah specialization
  156. 6:23ah those of you who have some background
  157. 6:26of object oriented systems would be
  158. 6:29familiar with
  159. 6:31the notion of specialization and
  160. 6:33generalization
  161. 6:35ah in object oriented systems we say
  162. 6:37that if we have a certain concept say we
  163. 6:40have a concept called person
  164. 6:42and then we say that
  165. 6:46a student is a person
  166. 6:48what you mean is a student is a
  167. 6:50specialization of person and person is a
  168. 6:52generalization of student and in that
  169. 6:54process student inherits
  170. 6:56all the attributes of person
  171. 6:59but
  172. 7:00in addition the student may have some
  173. 7:02specialized attributes
  174. 7:04so what it means that if you look
  175. 7:07from
  176. 7:08ah
  177. 7:09from the
  178. 7:11perspective of
  179. 7:13such
  180. 7:15specialization
  181. 7:17say if i draw like this this is an
  182. 7:20entity set a
  183. 7:21and this entity set b
  184. 7:23and
  185. 7:24to mark the specialization we show
  186. 7:28an arrow head with a blank triangle at
  187. 7:31that end
  188. 7:33so
  189. 7:34if we by this what we mean is b
  190. 7:37is a a
  191. 7:39so
  192. 7:41b inherits all the properties of a but
  193. 7:44can have some more properties
  194. 7:46so if you look at all the entities that
  195. 7:49a may have
  196. 7:51you will find that a sub group of the
  197. 7:53entities in the entity set a
  198. 7:56have some additional common properties
  199. 7:59so if a is set of persons
  200. 8:02and b is a set of students
  201. 8:04then a may have
  202. 8:06entities who which represent
  203. 8:09people who are not students who are
  204. 8:11employees
  205. 8:12who could be retired and so on
  206. 8:14but there will be a number of entities
  207. 8:16who have the commonality of being
  208. 8:18student they are
  209. 8:20enrolled in certain course of certain
  210. 8:22university and so on so
  211. 8:25in terms of the er diagram er model what
  212. 8:28we do is we try to look at
  213. 8:31the entity a and
  214. 8:34move top down
  215. 8:36so that whenever we find a group of
  216. 8:38entities which have certain commonality
  217. 8:41we move them into a
  218. 8:43lower separate specialized
  219. 8:46entity set and relate these two entity
  220. 8:49sets to the specialization relation
  221. 8:52so this sub groups form lower level
  222. 8:55entity sets
  223. 8:56and
  224. 8:58as i said that it is designated in a
  225. 9:01certain way
  226. 9:02and
  227. 9:03as in the object oriented system the
  228. 9:06lower level entity set inherits all the
  229. 9:09attributes
  230. 9:10and relationships of participation of
  231. 9:12the higher level entity side so here is
  232. 9:15an example you can see the person at the
  233. 9:18so called root of this hierarchy of
  234. 9:20specialization
  235. 9:22it has a set of properties id name
  236. 9:24street city and employee is another
  237. 9:27relationship another entity set which is
  238. 9:30a specialization of person relation
  239. 9:33person entity set so employee inherits
  240. 9:37all attributes id name street and city
  241. 9:40but in addition the commonality of the
  242. 9:43entities in the employee entity set is a
  243. 9:45fact that all of them have a salary
  244. 9:48attribute
  245. 9:49a similar entity set student is a
  246. 9:51specialization of person where
  247. 9:54the again all attributes are inherited
  248. 9:57but there is a common attribute called
  249. 10:00total credits
  250. 10:01which is common for all the students but
  251. 10:04is not available or common for the
  252. 10:07persons in general
  253. 10:08and as you can see that it could be
  254. 10:10hierarchical it could go further down
  255. 10:12employee could be specialized into
  256. 10:14instructor and secretary again by the
  257. 10:19rule of specialization instructor will
  258. 10:22inherit all attributes of employee which
  259. 10:24means that it will inherit attributes of
  260. 10:27person which employee has inherited
  261. 10:30plus the employee specific attribute
  262. 10:33salary so it will inherit all five of
  263. 10:35those attributes and then it adds
  264. 10:38another attribute which is specific for
  265. 10:40the instructor which says the rank which
  266. 10:43is is another specific attribute that
  267. 10:45you have
  268. 10:46now
  269. 10:47when you specialize a certain entity set
  270. 10:50into
  271. 10:50two or more entity sets like we
  272. 10:53specialize person in employee and
  273. 10:54student then there could be different
  274. 10:57situations that
  275. 10:58could exist for example certain entity
  276. 11:02may be a member of both employee as well
  277. 11:06as
  278. 11:06student
  279. 11:08if that happens then we say that they
  280. 11:10are overlapping entity sets
  281. 11:13or they could be
  282. 11:14disjoint
  283. 11:16where
  284. 11:17no member of instructor
  285. 11:20would be a member of the secretary and
  286. 11:24vice versa so we say that
  287. 11:26this disjointness
  288. 11:28tell us that
  289. 11:31no instructor can be a secretary and no
  290. 11:33secretary can be an instructor whereas
  291. 11:35overlapping
  292. 11:37specialized sets denote that well an
  293. 11:41employee may or may not be a student but
  294. 11:43it is possible that some employee is
  295. 11:45also a student and vice versa and that
  296. 11:48is how we will represent this
  297. 11:55and we will see that when we specialize
  298. 11:57the
  299. 11:59specialized entity could be total or
  300. 12:02they could be partial
  301. 12:04we will talk about that totality and
  302. 12:06partial little little later
  303. 12:08let us look at how do we represent this
  304. 12:10information in the relational schema
  305. 12:13because as we have seen that whenever we
  306. 12:16have a
  307. 12:17er diagram it is important to find out
  308. 12:20what is the
  309. 12:22relational schema that will be
  310. 12:24corresponding to that
  311. 12:26e r diagram or er model
  312. 12:28so
  313. 12:29here we could do this in two ways one
  314. 12:32that we are showing here is form a
  315. 12:34schema for the higher level entity so
  316. 12:36form a schema for the person as you can
  317. 12:39see here
  318. 12:40that person is described in terms of
  319. 12:42four attributes
  320. 12:44and this form is schema for each of the
  321. 12:46lower level entity set
  322. 12:48where you include the primary key of the
  323. 12:52higher level entity set so when you are
  324. 12:53forming the schema of
  325. 12:55person of student
  326. 12:57which is a specialization of person you
  327. 13:00include the id which is the
  328. 13:03key of the higher level entity set
  329. 13:06person
  330. 13:07and along with that you include the so
  331. 13:10called local attributes or attributes
  332. 13:12which are specific to this low level
  333. 13:14entity set in this case total credit
  334. 13:16similar thing happens with employee
  335. 13:19now this representation is in a way
  336. 13:21optimized because
  337. 13:23you
  338. 13:24are in representing the information only
  339. 13:27once when it is needed
  340. 13:29but the drawback is if you have to find
  341. 13:31out information about say employee
  342. 13:34then you will not only have to access
  343. 13:36the employee entity set or the
  344. 13:39corresponding
  345. 13:41relation in the relational schema but
  346. 13:43you will also have to access the parent
  347. 13:46or higher level entity set to get the
  348. 13:48attribute values which are inherited and
  349. 13:51if you have a multi-level hierarchy as
  350. 13:53we have shown this could involve
  351. 13:55accessing multiple relations to find
  352. 13:58information about a single entity in an
  353. 14:01entity set
  354. 14:03so
  355. 14:04this is an
  356. 14:06in terms of data representation this is
  357. 14:08an optimized representation but it has
  358. 14:11the overhead of having to access
  359. 14:13multiple
  360. 14:14ah entity sets to get information about
  361. 14:18certain entities
  362. 14:20an alternate scheme would be that
  363. 14:23based on the hierarchy of specialization
  364. 14:25you assume all attributes as they are
  365. 14:28inherited and then represent every
  366. 14:30entity set in full so when you the
  367. 14:32representation of person does not change
  368. 14:35but when you represent student
  369. 14:37now earlier you are just having id and
  370. 14:40total credit now in you include all
  371. 14:43entities that are inherited
  372. 14:45similarly you do the same thing so you
  373. 14:47have the all entities of the parent all
  374. 14:50attributes of the parent entity set as
  375. 14:52well as the local attribute of that
  376. 14:54specific entity set
  377. 14:56now this naturally makes it easy to
  378. 14:58extract information from a
  379. 15:00for a single entity set but
  380. 15:03at the same time you are storing the
  381. 15:06same ah
  382. 15:08data redundantly for people who are
  383. 15:11having overlapped representation so if
  384. 15:15we have
  385. 15:16as we know student and employer
  386. 15:17overlapped so the same entity will
  387. 15:20happen in student as well as in employee
  388. 15:24so it will the information of the common
  389. 15:26attributes name street city etcetera
  390. 15:29they will occur in both these tables in
  391. 15:32the design so these are two methods and
  392. 15:35now we have just ah given you the
  393. 15:38relative
  394. 15:39advantages and its advantages of the
  395. 15:41same and based on a particular situation
  396. 15:43you have to choose what is a good method
  397. 15:46to represent
  398. 15:50you can look at
  399. 15:51now you know from the object based
  400. 15:52system that if you have a specialization
  401. 15:55hierarchy you can think of it as a
  402. 15:57generalization hierarchy also
  403. 15:59the generalization hierarchy goes in a
  404. 16:01bottom up manner so instead of
  405. 16:04actually
  406. 16:06starting with an entity set and finding
  407. 16:08out subsets of entities which have
  408. 16:10greater commonality between them and
  409. 16:12putting them as specialized you could
  410. 16:14actually group them
  411. 16:16in
  412. 16:18the terms of finding out what they share
  413. 16:20and create a higher level entities
  414. 16:24for example the way i am saying is let
  415. 16:26us say that i have one entity set
  416. 16:29which say
  417. 16:31ug
  418. 16:32student
  419. 16:33and have another entity set in the same
  420. 16:35university which is a pg student
  421. 16:39so there are
  422. 16:40both of them are students naturally they
  423. 16:42are
  424. 16:43disjoint a person cannot be ug as well
  425. 16:45as pg student at the same time
  426. 16:47and once you represent that you find
  427. 16:49that well there are lot of information
  428. 16:51which are common between these two
  429. 16:53entity sets like the student roll number
  430. 16:56name
  431. 16:57and so on so forth so you could choose
  432. 17:00that well you instead of having them as
  433. 17:03two separate
  434. 17:05entity sets
  435. 17:07you could
  436. 17:08extract out the common attributes and
  437. 17:10put them at a higher level entity so all
  438. 17:12that you are doing is
  439. 17:14instead of going top down you are going
  440. 17:16bottom up in the whole approach
  441. 17:18so if you
  442. 17:20do that then ah there you can easily see
  443. 17:23that specialization and generalization
  444. 17:25is are inverse of each other
  445. 17:28and they are used interchangeably in
  446. 17:31terms of the relational
  447. 17:34entity relationship design
  448. 17:37the other constraint that you can
  449. 17:40identify you should identify is the
  450. 17:43constraint of completeness
  451. 17:45we say that if i have an
  452. 17:48entity set
  453. 17:51say person
  454. 17:53and
  455. 17:54then we have specializations of
  456. 17:57employee and student the question is
  457. 17:59for a higher level entity set
  458. 18:01is it necessarily that every entity
  459. 18:05will be represented in
  460. 18:08one of the or more than one of the lower
  461. 18:11level entity sets
  462. 18:13if that is guaranteed that an entity
  463. 18:16must belong to one of the lower level
  464. 18:18entity sets we say that it is a complete
  465. 18:22specialization
  466. 18:24but if it is that a
  467. 18:26higher level entity
  468. 18:29is may or may not be featuring in a
  469. 18:34entity set which is at a lower level
  470. 18:36then will say it is a partially
  471. 18:39specialized hierarchy so they both of
  472. 18:42these are are possible depending on
  473. 18:44different situation that we have
  474. 18:46so
  475. 18:47by default we assume partial
  476. 18:50specialization and
  477. 18:53so if we want to say certain
  478. 18:55specialization is total we will have to
  479. 18:58write the keyword total by the side of
  480. 19:00the arrow head that is representing the
  481. 19:03specialization hierarchy you can say
  482. 19:06that
  483. 19:06the example i talked of in uniting unite
  484. 19:10undergraduate and
  485. 19:12graduate or post graduate students into
  486. 19:15the entity set of students
  487. 19:17gives you a hierarchy which is
  488. 19:21total because every
  489. 19:23entity in the entity set student must be
  490. 19:26either a ug student or a pg student it
  491. 19:29is not possible that i have a student
  492. 19:31who is neither a ug student nor a pg
  493. 19:33student so every high entity the higher
  494. 19:35level entity set
  495. 19:37ah student must feature in one of these
  496. 19:39two specializations so therefore they
  497. 19:42are necessarily
  498. 19:45total in the relationship so this is the
  499. 19:47completeness constraint that you can
  500. 19:48think of
  501. 19:50moving on lets talk about
  502. 19:52another feature which is known as
  503. 19:53aggregation the situation is like this
  504. 19:56we have already talked about this part
  505. 19:59of the diagram
  506. 20:00which is a ternary relationship which
  507. 20:02relates project instructor and student
  508. 20:05now let us say once the project
  509. 20:07progresses you would need to add
  510. 20:09evaluation to that so here there is
  511. 20:11another entity set which represents
  512. 20:13evaluation i mean how you are grading or
  513. 20:16putting marks and so on so naturally the
  514. 20:18evaluation of
  515. 20:20a student will be dependent on the
  516. 20:24project the student and the supervisor
  517. 20:27and that will relate to the evaluation
  518. 20:29so evaluation
  519. 20:31eval for the relationship is necessarily
  520. 20:34a relationship between four entities
  521. 20:38or four entity sets so to say
  522. 20:41now the question is how do we represent
  523. 20:44this information
  524. 20:46the
  525. 20:47relationship
  526. 20:48sets eval for and project guide the two
  527. 20:51that we saw if we just want to recall
  528. 20:53once more the project guide involves
  529. 20:55three of the relation entity sets and
  530. 20:58the eval for
  531. 20:59relates to
  532. 21:00four of the entity sets
  533. 21:03now every eval for relationship
  534. 21:05corresponds to a
  535. 21:08project guide relationship that is if i
  536. 21:10have an entity individual for
  537. 21:11relationship
  538. 21:13i will have a corresponding entity in
  539. 21:15the project guide relationship which
  540. 21:16specifies the student project and the
  541. 21:18instructor
  542. 21:20so but
  543. 21:21it is other way it is possible that some
  544. 21:23project guide relationship may not
  545. 21:26correspond to any eval relationship that
  546. 21:28is it is possible that ah there is a
  547. 21:30allotted project by a student
  548. 21:33with a particular instructor which has
  549. 21:35yet not been evaluated the evaluation
  550. 21:37process is not complete or the time has
  551. 21:39not come
  552. 21:41so
  553. 21:42if we have to
  554. 21:43represent the information only for the
  555. 21:47eval for relationship we will get
  556. 21:49partial information because it is
  557. 21:52possible that some entities in eval 4
  558. 21:56does not have the evolve for information
  559. 21:58do not feature there but
  560. 22:00need to be preserved because i need to
  561. 22:03remember the project guide
  562. 22:06instructor the student and the project
  563. 22:09so we need to keep both duplicating the
  564. 22:12information
  565. 22:14so
  566. 22:15we can
  567. 22:16use aggregation to eliminate this ah
  568. 22:18duplication of information or redundancy
  569. 22:21of information
  570. 22:22so what we do is we treat the first
  571. 22:25entity first relationship the project
  572. 22:27gate relationship as if it is an
  573. 22:29abstract entity
  574. 22:31and then you allow relationship between
  575. 22:35two relationships this is something we
  576. 22:37did not do before relationship so far
  577. 22:40has always been between entity sets
  578. 22:42so what you can see that project guide
  579. 22:46relationship itself as if it is a
  580. 22:48virtual entity it is an abstract entity
  581. 22:51and then you allow the relationship
  582. 22:53between
  583. 22:54the project guide
  584. 22:56and the eval 4
  585. 22:58relationship which relates to the
  586. 23:01evaluation entity set
  587. 23:03ah this
  588. 23:04really this shows i mean i will just
  589. 23:06show you in the diagram so this is how
  590. 23:08it will
  591. 23:09now work out to be so this is the
  592. 23:15abstract
  593. 23:18project guide
  594. 23:20entity set which is an abstract entity
  595. 23:22set because it is actually relationship
  596. 23:25and that relates to eval for
  597. 23:27which on the other side has the
  598. 23:29evaluation so
  599. 23:31what will happen is a student is guided
  600. 23:33by a particular instructor in a
  601. 23:35particular project will feature in this
  602. 23:38abstract entity set
  603. 23:40which relates the three
  604. 23:41entity sets project student and
  605. 23:44instructor
  606. 23:45and
  607. 23:47if it has an evaluation then this
  608. 23:50through this
  609. 23:51relationship
  610. 23:52it will be represented
  611. 23:54and the evaluation
  612. 23:56value will exist so
  613. 23:58we know that if a project is evaluated
  614. 24:02then it certainly have a corresponding
  615. 24:04entity
  616. 24:05in the
  617. 24:06abstract entity set project guide but
  618. 24:09the reverse may not be true i may have
  619. 24:12an entity in the project guide entity
  620. 24:13set which does not have an evaluation so
  621. 24:16by using this aggregation model i can
  622. 24:19represent
  623. 24:20the information of
  624. 24:22this situation model this situation more
  625. 24:25accurately than i could do otherwise
  626. 24:30so this can be represented again how to
  627. 24:32represent this in terms of the schema so
  628. 24:35what we do we represent the aggregation
  629. 24:37we create a schema containing the
  630. 24:39primary key of the aggregated
  631. 24:42relationship
  632. 24:43the primary key of the associated entity
  633. 24:45set and all the other descriptive
  634. 24:48attributes and put them together
  635. 24:55so in our example
  636. 24:57the schema would be eval for and that
  637. 25:00schema will have
  638. 25:03these are
  639. 25:05entities these are attributes of the
  640. 25:08aggregated
  641. 25:10or abstract
  642. 25:12entity set which is coming from the
  643. 25:15student
  644. 25:16project and the instructor entities and
  645. 25:20this is for the
  646. 25:21evaluation id so we put this together so
  647. 25:25now you can see that all of these are
  648. 25:28related
  649. 25:31representing who is the guide of which
  650. 25:34student in what project
  651. 25:36and if this exists then this gives you
  652. 25:39the evaluation
  653. 25:41so naturally once this has been
  654. 25:42represented the project guide schema by
  655. 25:45itself
  656. 25:46becomes redundant and therefore it can
  657. 25:49be removed so this is a process through
  658. 25:51which we come to the
  659. 25:53the decision of actually having the
  660. 25:56schema to represent all the required
  661. 25:58information naturally if the evaluation
  662. 26:01is not done then the evaluation id ah
  663. 26:04for in eval for will not exist
  664. 26:08and that will be a null showing that it
  665. 26:11is not
  666. 26:12present right now
  667. 26:15ok now ah given
  668. 26:17these
  669. 26:18basic features as well as the extended
  670. 26:20features let me talk about a few design
  671. 26:23issues which will ah
  672. 26:26be
  673. 26:26required to see what kind of information
  674. 26:30that ah
  675. 26:32the the different challenges that we
  676. 26:34have seen so far
  677. 26:36for example we have seen the case of
  678. 26:38multi valued attributes
  679. 26:41so
  680. 26:42and
  681. 26:43the way we can represent that is
  682. 26:47using that multivalued attribute as a
  683. 26:49separate entity set like the phone
  684. 26:52number which also has the advantage of
  685. 26:54having its own
  686. 26:57added information for example
  687. 26:59once we do this then not only i can
  688. 27:02have against the same instructor id i
  689. 27:05can have multiple phone numbers but i
  690. 27:07can have location for each one of these
  691. 27:09phone numbers and i make use of
  692. 27:13this
  693. 27:14relation
  694. 27:15relationship that i create
  695. 27:17which allow me to ah represent this
  696. 27:21multivalued attribute so this is a
  697. 27:23common technique that will be used
  698. 27:25frequently in such cases
  699. 27:28you can have entities versus
  700. 27:30relationship for example ah if we
  701. 27:34have
  702. 27:35ah info we need to keep information
  703. 27:37about ah registration
  704. 27:40how students register to different
  705. 27:42sections then we could represent
  706. 27:44registration as an entity set and have
  707. 27:47different
  708. 27:49relationships of section registration
  709. 27:51which specify how registration is
  710. 27:53related to section
  711. 27:55and student dredge which specify how
  712. 27:58registration is related to student to
  713. 28:00represent that kind of information
  714. 28:03we can have placement of relationship
  715. 28:05attributes also attribute date we talked
  716. 28:07about as an attribute of advisor
  717. 28:10to designate
  718. 28:13as
  719. 28:14when that particular instructor became
  720. 28:17advisor of a student is a common ah
  721. 28:20situation that we have already seen
  722. 28:23there is also question of ah the choice
  723. 28:25being made between the binary and
  724. 28:27non-binary relationship ternary or
  725. 28:30higher degree
  726. 28:31now as it turns out that it is possible
  727. 28:34that you could represent
  728. 28:36ternary relationships directly or you
  729. 28:38can decompose that for example a ternary
  730. 28:40relationship can be decomposed in terms
  731. 28:42of two binary relationship
  732. 28:45for example let us say if we talk about
  733. 28:47ah persons then person every person has
  734. 28:50parents so
  735. 28:53he or she has a father and a mother
  736. 28:56now if we represent this as a ternary
  737. 28:59relationship
  738. 29:00then the one difficulty that we have
  739. 29:03that
  740. 29:04a person must have both the father and
  741. 29:08mother to be represented there for
  742. 29:10example if we can come to a situation
  743. 29:12where only the mother is known the
  744. 29:14father is not known i will not be able
  745. 29:16to represent that because it will always
  746. 29:18have to come
  747. 29:19as a triplet of
  748. 29:21three persons the the person under
  749. 29:23consideration
  750. 29:25her father and her mother but if i
  751. 29:27represent the person and the father in
  752. 29:30one relationship
  753. 29:32the person and the mother in another
  754. 29:34relationship then i can take care of the
  755. 29:36situation where
  756. 29:38when one of the parents are known i can
  757. 29:41still represent this
  758. 29:43so there are certain tradeoffs which can
  759. 29:45be done between the choice of binary and
  760. 29:47non-binary relationships but obviously
  761. 29:50there are certain relationships which
  762. 29:51are
  763. 29:52inherently non-binary for example the
  764. 29:54project guide example we have seen the
  765. 29:56project guide information cannot be
  766. 29:58decomposed
  767. 30:00ah without certain loss of information
  768. 30:02to be represented by say the instructor
  769. 30:04and the project and another relationship
  770. 30:06between the student and the project it
  771. 30:09really that does not represent the same
  772. 30:12information
  773. 30:13so
  774. 30:14ah in general you can
  775. 30:17convert a non-binary relationship by in
  776. 30:20the binary form by doing this so this is
  777. 30:22a ternary relationship being shown
  778. 30:24and for doing that these are the three
  779. 30:27entity sets
  780. 30:29involving the ternary relationship and
  781. 30:32to make decomposite into a ternary
  782. 30:34relationship what we do is into binary
  783. 30:37relationships we inject
  784. 30:40a new
  785. 30:41entity artificial entity set e
  786. 30:45and then we define three different
  787. 30:48relations between them so which
  788. 30:51individually relates to the entity sets
  789. 30:54a b and c so this is a standard
  790. 30:56decomposition and you can easily
  791. 30:58understand that ah
  792. 31:01a b and c in our earlier example could
  793. 31:03all be persons and
  794. 31:06r a
  795. 31:07could
  796. 31:08mean that father of
  797. 31:11r b could mean mother of and so on so i
  798. 31:13can do do it in decompose it in this
  799. 31:16manner and represent that
  800. 31:21now
  801. 31:23while we do this decomposition we will
  802. 31:25also have to remember in
  803. 31:26that we need to translate all
  804. 31:29constraints
  805. 31:30that are present for the ternary
  806. 31:33relationship
  807. 31:34and oftentimes it may become difficult
  808. 31:37to translate all constraints it may not
  809. 31:40be possible and there may be instances
  810. 31:42in the translated schema that cannot
  811. 31:44correspond to an instance of the
  812. 31:47original
  813. 31:48relationship so we will have to
  814. 31:51ah avoid
  815. 31:52we can we will have to take care of this
  816. 31:55situation by identifying attributes
  817. 31:59and making
  818. 32:00use of the weak entity sets which we
  819. 32:03have already
  820. 32:05seen in our earlier discussions so if we
  821. 32:08summarize the discussions on the year
  822. 32:11design decisions we see that the first
  823. 32:14decision that
  824. 32:16we need to take in case of design is the
  825. 32:19use of an attribute or entity set to
  826. 32:21represent the object so that is the
  827. 32:23first modeling that what is the concept
  828. 32:25and what is what are the attributes
  829. 32:28or what is the representing entity set
  830. 32:31for the object that we are trying to
  831. 32:33deal with instructor student
  832. 32:36project and so on
  833. 32:38and
  834. 32:39we will also have to see whether in the
  835. 32:41real world this actually is an entity
  836. 32:44set or it is a relationship set that it
  837. 32:47is ah not an concept by itself but is a
  838. 32:51concept which relates
  839. 32:53two or more entity sets and thereby
  840. 32:57becomes a set of representation
  841. 33:00the use of ternary relationship versus
  842. 33:03the pair of binary relationship this
  843. 33:04tradeoff will have to be weighed as a
  844. 33:07design consideration
  845. 33:08we have to look into the use of strong
  846. 33:11or weak entity set so we will have to
  847. 33:13identify the weak entity sets and see if
  848. 33:16they should be represented through the
  849. 33:18identifying relation
  850. 33:20ah
  851. 33:21as against a strong entity set
  852. 33:24we have to identify
  853. 33:26the specialization generalization
  854. 33:28situation where so that we can get more
  855. 33:31specific information
  856. 33:32and create
  857. 33:34appropriate modularity in the design
  858. 33:37we have to look at ah aggregation which
  859. 33:41where we can aggregate entity sets bound
  860. 33:44by a
  861. 33:45ah relationship
  862. 33:47and create an abstract single unit which
  863. 33:50can play a role of an independent entity
  864. 33:54set in the whole design
  865. 33:57so these are
  866. 33:58the basic
  867. 34:00so these are the basic design
  868. 34:03decisions that you need to make and we
  869. 34:06will certainly come up with lot more of
  870. 34:08design decisions as we go along
  871. 34:11and
  872. 34:12before i close
  873. 34:13in the presentation i have summarized
  874. 34:16the different symbols that are used in
  875. 34:18the er notation so i will not these have
  876. 34:21already been discussed in depth so i
  877. 34:23will not go through them one by one but
  878. 34:24i have put them as a list in
  879. 34:27the couple of slides there is a next
  880. 34:29slide in that which
  881. 34:31will be
  882. 34:33a quick reference for you while you are
  883. 34:35initially doing the er diagram so that
  884. 34:37you know exactly which symbol to pick up
  885. 34:39for what situation
  886. 34:41and at the end also there are few slides
  887. 34:44which show you that the ear notation
  888. 34:47itself is not a unique one there are
  889. 34:49multiple
  890. 34:50ways to represent similar things for
  891. 34:52example this is one which is showing you
  892. 34:55different composite attributes ah the
  893. 34:59generalization relationship is shown
  894. 35:01differently so there are these are all
  895. 35:04different styles of
  896. 35:05showing
  897. 35:07the
  898. 35:09constraints that that apply to a
  899. 35:11particular
  900. 35:13relationship
  901. 35:14and
  902. 35:15we will i mean we have included this ah
  903. 35:18not because we will use these alternate
  904. 35:20notations but i haven't quit them
  905. 35:22because
  906. 35:23it is possible that you come across some
  907. 35:25ear
  908. 35:27diagram where these notations are used
  909. 35:29and if you come across and you are not
  910. 35:31able to identify then please refer to
  911. 35:33this slides and you will be able to
  912. 35:35recognize what is ah what is
  913. 35:38corresponding symbol that you already
  914. 35:40know
  915. 35:40so in this module we have discussed the
  916. 35:42extended features of your model and we
  917. 35:44have
  918. 35:46deliberated on certain design issues and
  919. 35:49we will close our discussion on the
  920. 35:51entity relationship model here and move
  921. 35:54on to discuss the
  922. 35:56actual relational design

About this transcript

This page contains the full transcript of Entity-Relationship Model/3 by Data Base Management System - IITKGP, generated from the public captions YouTube serves with the video. The transcript has 4,755 words across 922 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.