YouTube2Text

Entity-Relationship Model/2 — Transcript

by Data Base Management System - IITKGP · 3,883 words · 757 segments · language en · Watch on YouTube

Full transcript

  1. 0:00[Music]
  2. 0:15welcome to module 14 of
  3. 0:19database management systems
  4. 0:21in the last module we started our
  5. 0:23discussions on the entity relationship
  6. 0:25model
  7. 0:26we will continue that in
  8. 0:28this module as well and actually
  9. 0:31conclude it in the next module so these
  10. 0:34are the
  11. 0:36items that we had discussed in the last
  12. 0:38module
  13. 0:39in the present one
  14. 0:42we will first illustrate the
  15. 0:44entity relationship diagram notation
  16. 0:47that graphical notation for
  17. 0:50er model how
  18. 0:51nicely this can be shown in terms of
  19. 0:54certain diagrams
  20. 0:55and
  21. 0:57then we will explore how er models can
  22. 1:00be
  23. 1:01translated to relational schemas which
  24. 1:04is a basic step
  25. 1:06of
  26. 1:07the logical design
  27. 1:11so these are the
  28. 1:13topics so we start with the er diagram
  29. 1:17naturally the first thing to represent
  30. 1:19in
  31. 1:20an er model is the entity set every
  32. 1:23entity set is represented by a rectangle
  33. 1:26on the top
  34. 1:28we write the name of that entity set as
  35. 1:30you can see examples here the instructor
  36. 1:33and student are the two entity sets
  37. 1:35and below that we write
  38. 1:37the names of the attributes that are
  39. 1:40involved
  40. 1:41and we underline the attribute or
  41. 1:43attributes that form the primary key of
  42. 1:46that entity site
  43. 1:50a relationship between ah two entity
  44. 1:53sets is represented by a diamond
  45. 1:57and two connecting lines to the two
  46. 1:59entity sets so here it says that advisor
  47. 2:03is a relationship between entity set
  48. 2:06instructor and entity set student
  49. 2:09trying to
  50. 2:10convey the real world situation that
  51. 2:14students are advised by
  52. 2:17the instructors or students have
  53. 2:19instructors and so on
  54. 2:24as we had mentioned that relationships
  55. 2:27could also have attributes
  56. 2:29so if the advisor relationship has an
  57. 2:31attribute date
  58. 2:33then it will be tagged to the advisor
  59. 2:36relationship
  60. 2:38with
  61. 2:39the attribute coming as a
  62. 2:41within a rectangle and attached to the
  63. 2:43name of the relationship
  64. 2:47by a dotted line
  65. 2:49so this shows that advisor is the
  66. 2:50relationship between instructor and
  67. 2:52student
  68. 2:53and the advisor relationship has an
  69. 2:55attribute date
  70. 2:59it is possible that
  71. 3:01the
  72. 3:02relationship
  73. 3:04that hold between
  74. 3:06two entity sets
  75. 3:08can be can use
  76. 3:11entity sets which are same that is it is
  77. 3:13possible that a set is related to itself
  78. 3:17so as an example we show the entity set
  79. 3:21course
  80. 3:22which has a relationship
  81. 3:25prereq prerequisite
  82. 3:27which takes a course id
  83. 3:30and relates it to another course id
  84. 3:33called the prerequisite id
  85. 3:35because obviously a co if a course has a
  86. 3:37prerequisite then that prerequisite
  87. 3:40itself is another course id which must
  88. 3:42occur in this table itself
  89. 3:45so in this case if you can see that
  90. 3:48unlike the earlier case ah the
  91. 3:51prereq id is not actually a field of
  92. 3:53this ah
  93. 3:55relation course so we say these are
  94. 3:57rules
  95. 3:58so we say the role
  96. 4:00that prereq relate
  97. 4:03from the course
  98. 4:06relation to itself
  99. 4:09are
  100. 4:11course id and
  101. 4:13id
  102. 4:14where in the actual table both of them
  103. 4:17relate to course id but prereq will
  104. 4:21pair them to show
  105. 4:23which course has what prerequisite
  106. 4:28and we often need this kind of we have
  107. 4:31seen
  108. 4:32ah similar instances of this while we
  109. 4:34treated dealt with the recursive queries
  110. 4:37in databases the source destination of
  111. 4:41ah
  112. 4:42airlines problem that we discussed has
  113. 4:45similar kind of relationship structure
  114. 4:47so you can think about a relationship
  115. 4:49flies
  116. 4:51from the set of ah
  117. 4:54source to this set of destination
  118. 4:58and basically this
  119. 4:59these two sets the places
  120. 5:02source places in the destination place
  121. 5:03are necessarily the same set the same
  122. 5:06relation
  123. 5:08there could be a constraint on the
  124. 5:10cardinality so
  125. 5:11the line that links the relationship
  126. 5:15diamond with the rectangles of the
  127. 5:19relations rectangles of the entity sets
  128. 5:24those lines could have an arrow at the
  129. 5:27end or may not have an arrow at the end
  130. 5:30so
  131. 5:31if it has got an arrow then it means
  132. 5:34that suppose it has an arrow it means
  133. 5:37one
  134. 5:38and if it does not have a arrow if it is
  135. 5:40simple then it means many
  136. 5:42so using this notation we can
  137. 5:45designate
  138. 5:47one to one one to many these all
  139. 5:49different kinds of
  140. 5:51cardinalities that we had discussed
  141. 5:54so for example if we are showing this
  142. 5:57ah arrow on both hands both ends of this
  143. 6:01relationship advisor then it means that
  144. 6:05it is a one to one relationship because
  145. 6:07there is an arrow here so this is one
  146. 6:11there is an arrow here so this is one
  147. 6:14there is an arrow here so this is one
  148. 6:17which means that a student is associated
  149. 6:19at most
  150. 6:21with at most one instructor
  151. 6:23and it also means that
  152. 6:26an instructor is associated with at most
  153. 6:28a student
  154. 6:30this may not be a reality this usually
  155. 6:31is not the reality but this we are just
  156. 6:34showing this as an example
  157. 6:36so
  158. 6:37if the student
  159. 6:39instructor relationship
  160. 6:42advisor relationship is one to one
  161. 6:45then this is how we will denote it
  162. 6:52if it is
  163. 6:54one to many
  164. 6:57so
  165. 6:59which side is one this side is one
  166. 7:01and this side is many
  167. 7:03so it is one too many from instructor to
  168. 7:07student which says that every student
  169. 7:10has at most one instructor
  170. 7:12and an instructor may have several
  171. 7:16students it could be null also it could
  172. 7:18be none also
  173. 7:20so for an instructor here there are many
  174. 7:23students but for a student here there
  175. 7:25are only at most one instructor so its
  176. 7:28one to many and this is how we designate
  177. 7:32a similar thing will happen if i read
  178. 7:35the same relation in the other direction
  179. 7:39so instructor to student was one to many
  180. 7:42so student instructor also drawn in the
  181. 7:44same way because this is
  182. 7:46ah
  183. 7:48this is the one side
  184. 7:51this is the one side and this is the
  185. 7:52many side so it situation is the same
  186. 7:55so
  187. 7:56if we read from the student to
  188. 7:58instructor then it is also designates
  189. 8:00the many to one relationship
  190. 8:04and finally we can have a many to many
  191. 8:06relationship where there is no arrow at
  192. 8:08either end which means that an
  193. 8:10instructor is associated with
  194. 8:13several possibly none
  195. 8:14no student via the advisor relation and
  196. 8:17the student may also have several
  197. 8:19instructors by the advisor relationship
  198. 8:21now you can you can certainly
  199. 8:23ah
  200. 8:24figure out that in the particular case
  201. 8:26of student
  202. 8:28instructor scenario of providing advice
  203. 8:31one to one as well as many too many are
  204. 8:33not
  205. 8:34the usual real world scenarios
  206. 8:37but ah these are we have just using to
  207. 8:41show you how to model this usual
  208. 8:43scenario would be from instructor to
  209. 8:44student it is one too many relationship
  210. 8:51a relationship could be
  211. 8:55total or it could be partial
  212. 8:57if a
  213. 8:58if one side of the relationship or
  214. 9:00whichever side of the relationship is
  215. 9:03total
  216. 9:05then we draw
  217. 9:06a double line so you can you can see
  218. 9:09here in the diagram we are drawing a
  219. 9:10double line which means that in the
  220. 9:13advisor relationship the involvement of
  221. 9:15the student is total which means that
  222. 9:18every student
  223. 9:20must feature in the advisor relationship
  224. 9:22or in other words every student must
  225. 9:25have an advisor
  226. 9:27but it is
  227. 9:31partial on the
  228. 9:35instructor side
  229. 9:37because every instructor
  230. 9:40may not have a student
  231. 9:46so this double line
  232. 9:48shows that reality
  233. 9:53some entities may not participate in any
  234. 9:55relationship is a partial
  235. 10:00now
  236. 10:01this
  237. 10:02constraints the cardinality constraints
  238. 10:04can be made more precise by actually
  239. 10:07using numbers
  240. 10:09you can actually say on the two sides of
  241. 10:11the relationship
  242. 10:12that at the minimum how many entities
  243. 10:14should relate and at the maximum how
  244. 10:16many entities can relate
  245. 10:19for example if we are saying
  246. 10:21that ah
  247. 10:24we are on the right hand side here if
  248. 10:26you see we are saying
  249. 10:27that
  250. 10:28it is maximum minimum is 1 maximum is
  251. 10:31one
  252. 10:32which what does it say it says that
  253. 10:35every student
  254. 10:37the minimum is one so every student must
  255. 10:39feature in the advisor relationship
  256. 10:42so
  257. 10:44in real world every student must have
  258. 10:47a an advisor must have an instructor
  259. 10:51it says maximum is one which says that
  260. 10:54every student can have at most one
  261. 10:56instructor
  262. 10:58so this one to one one dot dot one says
  263. 11:00that every student must have at least
  264. 11:02one instructor every student must have
  265. 11:05at most one instructor so together it
  266. 11:07says that every student must have
  267. 11:09exactly one instructor
  268. 11:12whereas if i if you see on this side it
  269. 11:15says that 0
  270. 11:17dot dot star star stands for no limit
  271. 11:22it can be anything any number
  272. 11:24so the minimum is 0 which means that an
  273. 11:26instructor may not have a student
  274. 11:29and star says that it the instructor can
  275. 11:31have any number of student
  276. 11:34naturally 0 1 2 3 4 2 or 200 so any
  277. 11:38instructor can advise any number of
  278. 11:40students
  279. 11:41so these kind of precise
  280. 11:44number constraints
  281. 11:46can be put in addition to the one to
  282. 11:50many or one to one many to many kind of
  283. 11:53notations in the diagram so when we do
  284. 11:56that we have the precise cardinality of
  285. 11:58the complex relations that exist
  286. 12:11next we take a look into the handling of
  287. 12:14the complex attributes
  288. 12:16the first you remember that first kind
  289. 12:19of complex attribute is one which is
  290. 12:21composite
  291. 12:22say name which has first name middle
  292. 12:24name
  293. 12:25initial
  294. 12:27middle initials and
  295. 12:29last name
  296. 12:36so
  297. 12:38when we have that then
  298. 12:42the way we represent is
  299. 12:44at the
  300. 12:46actual name of the attribute is at the
  301. 12:48outermost level
  302. 12:50and its
  303. 12:52composites are written with
  304. 12:55certain
  305. 12:56shift on the left so these all say that
  306. 12:58these are composites of name
  307. 13:01so it this says that street city state
  308. 13:04zip are composites of address
  309. 13:07and further indentation say that these
  310. 13:10are composites of straight
  311. 13:12so
  312. 13:13this is how graphically we show
  313. 13:15that
  314. 13:16how complex attributes feature
  315. 13:24now
  316. 13:25let us go back to discussing the weak
  317. 13:27entity sets
  318. 13:29in the ear diagram a weak entity set
  319. 13:32is represented by a double
  320. 13:36rectangle you remember the section is a
  321. 13:38weak entity set and why is it so
  322. 13:40because a same course may have
  323. 13:44two different i am sorry two different
  324. 13:46courses may have the same section id
  325. 13:49semester and year that is two courses
  326. 13:51two or more courses
  327. 13:53may run
  328. 13:54sections by the same name in the same
  329. 13:56semester and the year
  330. 13:58so a section cannot be uniquely
  331. 14:00identified by these three
  332. 14:03attributes
  333. 14:04it needs a relationship
  334. 14:07with the identifying entity set course
  335. 14:12to be specific the course id
  336. 14:14so that the entities here in can be
  337. 14:17uniquely specified
  338. 14:19so since this has happened so we
  339. 14:21designate that by putting this
  340. 14:25double rectangle around the weak entity
  341. 14:28set section
  342. 14:32we underline the discriminator of a weak
  343. 14:34entity set with dashed line so you
  344. 14:37remember these are the discriminators
  345. 14:40because given the identifying
  346. 14:44attribute in the identifying set
  347. 14:46these are the
  348. 14:48attributes which distinguish
  349. 14:51different tuples of section
  350. 14:54so
  351. 14:55they are not shown
  352. 14:56with solid underline they are shown as
  353. 14:59dotted underline dashed underlined so
  354. 15:02that you can make out that this is the
  355. 15:03weak entity set and these are the
  356. 15:05discriminators
  357. 15:10the relationship set connecting the weak
  358. 15:12entity set to the identifying strong
  359. 15:14entity set is also
  360. 15:16so this the moment you have weak entity
  361. 15:18set you know that there has to be a
  362. 15:20relationship
  363. 15:21to the strong entity set which
  364. 15:23identifies it so that relationship sec
  365. 15:26course which say
  366. 15:28course id against this
  367. 15:31binds that
  368. 15:32is
  369. 15:33designated with a double diamond so that
  370. 15:36you know that this is
  371. 15:38the
  372. 15:38identifying relationship
  373. 15:41between a weak entity set and the
  374. 15:43corresponding strong entity set
  375. 15:48and once that happens then the primary
  376. 15:50key becomes
  377. 15:52the discriminators of section the weak
  378. 15:55entity set and the primary key of the
  379. 15:59identifying a strong entity set the
  380. 16:02course
  381. 16:03so that forms our
  382. 16:06final
  383. 16:07primary key for this entity set section
  384. 16:10mind your course id is not
  385. 16:12a part of
  386. 16:14this relation but it actually plays the
  387. 16:16role
  388. 16:17through this section id
  389. 16:19as a key for the section
  390. 16:22relation without which the section
  391. 16:25entities in the section cannot be
  392. 16:27uniquely identified
  393. 16:30so having said that this is a the er
  394. 16:33diagram of the university enterprise
  395. 16:36some of the points that you could take a
  396. 16:38look at
  397. 16:39this is the weak entity set we have just
  398. 16:41seen this is the
  399. 16:44relationship to the identifying strong
  400. 16:46entity set
  401. 16:49this is a prerequisite
  402. 16:51multi role
  403. 16:52relationship
  404. 16:54ah this you can see is a is a total
  405. 16:59involvement
  406. 17:00so why is it a total involvement because
  407. 17:02every section must have at least
  408. 17:05one teacher so there cannot be a section
  409. 17:08which does not feature in the teachers
  410. 17:10relationship
  411. 17:11similarly every section must get a time
  412. 17:14slot
  413. 17:15where
  414. 17:16the classes for that section is held
  415. 17:18so every section must feature in the sec
  416. 17:21time slot so these are the
  417. 17:23similarly it must get a class room so
  418. 17:26these are all different
  419. 17:28total ah
  420. 17:31involvements that we total roles that
  421. 17:33you can see we can see some of that
  422. 17:34elsewhere as well
  423. 17:36for example you can see it here we can
  424. 17:38see it here
  425. 17:39because in between instructor
  426. 17:42and the department the ins department
  427. 17:45relationship
  428. 17:46certainly every instructor must have a
  429. 17:48department so it is total
  430. 17:50but it is not the same for the
  431. 17:52department every department will not
  432. 17:54have instructors
  433. 17:56so
  434. 17:57this is how if we can you can go through
  435. 18:00carefully and
  436. 18:01for example this is another which is
  437. 18:03total which means that every course
  438. 18:06need a department you cannot run a
  439. 18:08course which does not have a department
  440. 18:11so
  441. 18:12this is how we can see that how the er
  442. 18:15diagram the first conceptual level
  443. 18:17diagram of a very simple university
  444. 18:20enterprise is being designed
  445. 18:22following the notions and symbols of er
  446. 18:26model that we have already developed
  447. 18:30next comes ah the part where from this
  448. 18:33model which is primarily diagram based
  449. 18:35we have to really go to the relational
  450. 18:37schema which is names of relations and
  451. 18:40attributes which is
  452. 18:41ah pretty much a straight forward job so
  453. 18:44entity sets and relationship sets have
  454. 18:46to be represented in terms of relational
  455. 18:49schema what is the beauty of the
  456. 18:52er model and the relational schema is
  457. 18:54that that when you reduce the entity
  458. 18:57relationship model to relational schema
  459. 18:59both entity sets and relationships
  460. 19:02sets both of them turn out to be
  461. 19:04relational schemas
  462. 19:06so that the database finally can be
  463. 19:08represented simply as a set of
  464. 19:11schemas each one of which must have a
  465. 19:15set of identifying primary key
  466. 19:19so let us
  467. 19:22look into that so on the
  468. 19:25strong entity set that reduces to schema
  469. 19:28with the same attributes is student so
  470. 19:31student has id
  471. 19:33name and total credit
  472. 19:35so which we
  473. 19:37saw earlier now this gets converted to a
  474. 19:39schema with id being the
  475. 19:43primary key
  476. 19:45the other case of weak entity set
  477. 19:47section
  478. 19:48which had three discriminators and true
  479. 19:51sec course relationship was
  480. 19:54identified from the strong entity set
  481. 19:57course
  482. 19:58borrows the
  483. 20:00primary key of the course to be defined
  484. 20:03in terms of this
  485. 20:05relational schema
  486. 20:08one moment
  487. 20:11this borrows
  488. 20:13the primary key from here
  489. 20:15and becomes
  490. 20:17so you can see that
  491. 20:19in the er model
  492. 20:21the section did not have
  493. 20:23course id as an attribute but
  494. 20:26while we reduce this to the relational
  495. 20:29schema
  496. 20:30through this sec course relationship we
  497. 20:33have borrowed this primary key from
  498. 20:35course
  499. 20:36the primary key of course
  500. 20:38the course id
  501. 20:40and added that to section to make it a
  502. 20:42complete relational
  503. 20:44schema
  504. 20:49next comes the representation of
  505. 20:51relationships so we are showing a
  506. 20:53relationship advisor so which relates
  507. 20:56instructors to students so naturally
  508. 20:59every instructor is identified by id
  509. 21:02every student is identified by id
  510. 21:05since both of the attributes have the
  511. 21:07same name id we are
  512. 21:09calling them as s underscore id and for
  513. 21:11the student and i underscore id for the
  514. 21:13instructor so the advisor relation is
  515. 21:17basically
  516. 21:18a pairing of these two ids
  517. 21:21which gives rise to a relationship
  518. 21:24which looks like this relationship
  519. 21:26schema which looks like this so we can
  520. 21:28in general say that if we have a
  521. 21:29relationship ah
  522. 21:31in the er model which we want to
  523. 21:33represent in the
  524. 21:35schema then we will take
  525. 21:38we will create a schema which has the
  526. 21:42primary key of both the sets and put
  527. 21:44them together and if the names clash we
  528. 21:47will just change the name with the
  529. 21:50name of the relation and that will give
  530. 21:53us the schema for the relationship
  531. 21:56in this case the advisor
  532. 21:58so we have seen how to represent entity
  533. 22:00sets weak entity sets and
  534. 22:03relationships ah let us look at how do
  535. 22:05we deal with composite attributes
  536. 22:07because ah
  537. 22:09so far we had assumed that
  538. 22:11the relational schema has attributes and
  539. 22:14every attribute has a domain
  540. 22:17ah the type from where its values come
  541. 22:19so if i have a composite attribute where
  542. 22:22every attribute has a set of components
  543. 22:24then the easiest way to handle this is
  544. 22:26to what is known as flatten
  545. 22:29the composite attribute so flattening
  546. 22:31basically is for example if i take a
  547. 22:34name it has three
  548. 22:36components so each one of them i can
  549. 22:39call by
  550. 22:40given new name name underscore first
  551. 22:43name name underscore middle initial name
  552. 22:45underscore last name
  553. 22:47by prefixing with the attribute name
  554. 22:51i make the names of these components
  555. 22:53necessarily unique
  556. 22:55now
  557. 22:56after i do the prefixing i might figure
  558. 22:59out that actually prefixing is not
  559. 23:01required first name itself is a unique
  560. 23:03because it does not occur anywhere else
  561. 23:05if it is then i can i may drop the
  562. 23:08prefix name but in general i can take
  563. 23:11the attribute name prefix on the
  564. 23:13component and just flatten them out make
  565. 23:15them all attributes each separate
  566. 23:18attribute so
  567. 23:20here when we ah flatten out we will have
  568. 23:24ah first name
  569. 23:26middle initial last name as you can see
  570. 23:29these
  571. 23:32flattened out from here
  572. 23:35then we have street number
  573. 23:37street name
  574. 23:38apartment number flattened out from the
  575. 23:41street
  576. 23:42subsequently we have city state zip
  577. 23:45flattened out from here so all of them
  578. 23:47flattened out has become separate
  579. 23:49attributes and flattening is a very
  580. 23:52straightforward mechanism by which you
  581. 23:54can convert complex composite attributes
  582. 23:57into the
  583. 23:58regular schema design
  584. 24:02you get into little bit of issue if you
  585. 24:04have multi valued attribute multivalued
  586. 24:06attribute is one where one attribute may
  587. 24:09have multiple values at the same time
  588. 24:11and the example we talked about
  589. 24:14is ah
  590. 24:15a phone number i may have multiple phone
  591. 24:17numbers
  592. 24:18so certainly against an attribute i can
  593. 24:21keep only one value
  594. 24:23so if i if my attribute is multiple
  595. 24:25value then the basic idea is to use a
  596. 24:27separate schema to maintain this
  597. 24:30multiple values for example if i have to
  598. 24:32maintain multiple
  599. 24:34phone numbers of an instructor i may
  600. 24:36have a separate i may decide to have a
  601. 24:38separate relation
  602. 24:40which relates the key of the
  603. 24:42instructor relation
  604. 24:44and
  605. 24:45the attribute that i want to
  606. 24:47ah maintain multiply so in this
  607. 24:50relationship in this relation
  608. 24:52inst
  609. 24:53underscore phone against the same id
  610. 24:56i can have
  611. 24:57different phone numbers so there will be
  612. 24:58different records which match on the id
  613. 25:01but do not match on the phone number
  614. 25:03which gives me the different values that
  615. 25:05the phone number can take
  616. 25:07and then
  617. 25:08this inst phone in conjunction with the
  618. 25:10instructor relation will actually denote
  619. 25:15the
  620. 25:15multivalued
  621. 25:17phone number attribute so this is just
  622. 25:20an example showing that
  623. 25:22for one primary key of an instructor
  624. 25:26ah one
  625. 25:27two two two two two
  626. 25:29and there are two phone numbers so this
  627. 25:31will basically mean you have two tuples
  628. 25:33in the new relation
  629. 25:35so with that we can ah handle multiple
  630. 25:38multi valued attributes also
  631. 25:42some of the relationships that we may
  632. 25:44have modeled which we have done
  633. 25:47in
  634. 25:48doing the
  635. 25:50database er schema
  636. 25:52could have redundancy for example take a
  637. 25:55case here we have the instructor
  638. 25:58and we have the student the advisor
  639. 26:00relation is incidental here
  640. 26:02and we have department
  641. 26:04so we want to say that the instructors
  642. 26:06belong to
  643. 26:07certain departments every instructor
  644. 26:09belongs to one department which is the
  645. 26:11totality of the relationship here
  646. 26:13similarly every student belongs to a
  647. 26:15department totality of the relationship
  648. 26:16on this side
  649. 26:18and inst debt
  650. 26:20ins debt in that context is a
  651. 26:22relationship
  652. 26:23which is between instructor and
  653. 26:26department similarly
  654. 26:31so we can
  655. 26:33there is certain redundancy in this
  656. 26:35because
  657. 26:36we can get make this simpler if we just
  658. 26:39take the
  659. 26:42primary key of this relation and put in
  660. 26:44here
  661. 26:47if we do that then basically this become
  662. 26:50redundant these are normal required so
  663. 26:52all that you are saying is the
  664. 26:54instructor has a depth name field which
  665. 26:57says which department does it belong to
  666. 27:00so if there is a choice between whether
  667. 27:02you will keep such
  668. 27:04relationships or you will
  669. 27:07actually
  670. 27:08reduce the redundancy in the schema and
  671. 27:11involve the
  672. 27:12primary key of the other relation into
  673. 27:16your
  674. 27:17primary table which is instructor or the
  675. 27:20student here
  676. 27:23so instead instead of creating a schema
  677. 27:25for relationships at ins department
  678. 27:27you will simply add a department name
  679. 27:30so mind you this is at the er model
  680. 27:32level you did have a separate
  681. 27:34relationship but while you reduce it to
  682. 27:38your relationship relational schema you
  683. 27:41are reducing that relationship by
  684. 27:44including the depth name as an attribute
  685. 27:47in instructor so that is called the
  686. 27:49reduction of schema which is often used
  687. 27:54ah for one to one relationship so this
  688. 27:56is this was ah this is a good if you
  689. 28:00have many to one relation because this
  690. 28:02was possible because
  691. 28:04every instructor has one department so
  692. 28:07if you just include the department name
  693. 28:09with the instructor or every student has
  694. 28:12one department
  695. 28:14ah so it is possible that way but if you
  696. 28:17have a one to one relationship
  697. 28:19then naturally
  698. 28:21you can do the similar reduction
  699. 28:23by i by choosing the either side
  700. 28:26as as the many you know because because
  701. 28:28the the unique side has to come on the
  702. 28:30many side the unique side here this is
  703. 28:33the unique side here
  704. 28:35because
  705. 28:36every instructor has a unique department
  706. 28:38and this is the many side here so the
  707. 28:40unique side has to attribute has to come
  708. 28:42in here the unique side primary key has
  709. 28:44to come in here so instead of ah
  710. 28:49so you can
  711. 28:50apply the same principle to a one to one
  712. 28:52relationship by treating any one of them
  713. 28:54as a many side
  714. 28:56and add the extra attribute on the other
  715. 28:58side to get rid of this additional
  716. 29:01schema the schema corresponding to a
  717. 29:03relationship set linking a weak entity
  718. 29:06set to its underlying strong entity set
  719. 29:08is certainly redundant we have already
  720. 29:11sent this
  721. 29:12so this ah
  722. 29:15is made redundant by including
  723. 29:18the
  724. 29:19primary key of the identifying relation
  725. 29:23identifying entity set in the weak
  726. 29:25entity set
  727. 29:27so that is another reduction
  728. 29:29of schema that can be
  729. 29:31done
  730. 29:32so to summarize ah
  731. 29:35we have in this module
  732. 29:37illustrated the entity relationship
  733. 29:40diagram which are very nice ways of
  734. 29:43graphically representing what we see in
  735. 29:46the
  736. 29:47real world
  737. 29:49so it has graphical representation of
  738. 29:51entity set
  739. 29:53attributes
  740. 29:54the key attributes primary key
  741. 29:56attributes
  742. 29:58the weak entity sets
  743. 30:00and
  744. 30:01the relationships
  745. 30:05along with the cardinality information
  746. 30:08and then we have shown that using
  747. 30:11certain reduction rules
  748. 30:14how we can easily reduce this
  749. 30:17entity relationship diagram or entity
  750. 30:19relationship model
  751. 30:22into the
  752. 30:23traditional
  753. 30:24relational schema
  754. 30:26and we have seen that both the entity
  755. 30:29sets
  756. 30:30as well as the relationship sets become
  757. 30:33relational schemas

About this transcript

This page contains the full transcript of Entity-Relationship Model/2 by Data Base Management System - IITKGP, generated from the public captions YouTube serves with the video. The transcript has 3,883 words across 757 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.