Entity-Relationship Model/1 — Transcript
Full transcript
- 0:07so
- 0:09[Music]
- 0:16welcome to module 13 of database
- 0:19management systems
- 0:21in this module and the next two
- 0:23we will discuss about entity
- 0:26relationship model
- 0:28so far we have
- 0:31had a good look into the sql language
- 0:33the query language
- 0:35and
- 0:36its formal basis in terms of relational
- 0:39algebra and calculate
- 0:42in this module we will and try to
- 0:44understand the design process for
- 0:46database systems
- 0:48because so far whatever we have done
- 0:51we have assumed that the schema is known
- 0:54to us
- 0:55that some instance is given to us and
- 0:58then we have tried to
- 1:01extract different query information
- 1:04from the relation but now we will look
- 1:07into how do we
- 1:10model the real world and actually get
- 1:12into the design process
- 1:15so after an overview of the design
- 1:17process
- 1:18we would
- 1:19study
- 1:20entity relationship model
- 1:23which is used to represent the real
- 1:26world whatever exist in the real world
- 1:28that will have to be represented
- 1:31for our use and
- 1:34final
- 1:36representation in terms of different
- 1:38relations
- 1:41the design process at an abstract level
- 1:43the initial
- 1:44phase of database design
- 1:46certainly has to characterize what data
- 1:50is required to be maintained
- 1:52for an enterprise
- 1:54so
- 1:55whether i am doing if i am doing an
- 1:57university database naturally we will
- 1:59need to identify that what are the data
- 2:02needs the students need to be described
- 2:04the
- 2:05instructors need to be described the
- 2:07courses sections time slots grades
- 2:10examinations etcetera but if i am trying
- 2:13to deal with a world which is ah say
- 2:17railway reservation then i will need to
- 2:20deal with the stations trains
- 2:23dates births
- 2:25the different classes of coach that the
- 2:28train has and so on so the initial phase
- 2:30is to characterize the data requirement
- 2:34next the designer has to choose a data
- 2:37model
- 2:38because
- 2:39unless we can
- 2:41we cannot
- 2:43deal with
- 2:44a natural language or english kind of
- 2:46description
- 2:48and
- 2:49work towards getting a particular schema
- 2:53so we will need to use a data model
- 2:56and
- 2:57apply the concepts of the data model
- 2:59that we choose
- 3:01and translate the requirements into what
- 3:03is known as a conceptual schema of the
- 3:06database
- 3:07which is not a not a very concrete one
- 3:09but a conceptual one this is what
- 3:11grossly what i want to do
- 3:14and a fully developed conceptual schema
- 3:17will indicate
- 3:18my functional requirements
- 3:21in terms of what usually is called
- 3:24a specification of functional
- 3:27requirements
- 3:28system requirements
- 3:31it will specify
- 3:33what kind of users
- 3:35will be involved what kinds of
- 3:37operations transactions will be
- 3:38performed and so on
- 3:41now once we have that
- 3:43kind of a conceptual model that abstract
- 3:47that is a conceptual more abstract data
- 3:49model
- 3:50will go to the next phase of the design
- 3:54which is finding out
- 3:56what is the more concrete design through
- 4:00a process of logical design
- 4:03in the process of logical design we will
- 4:05first decide on the database schema
- 4:09we need to decide on what is a good
- 4:12schema so there are
- 4:15principles to say that
- 4:17what is good and what is not so good
- 4:21we need to make business decisions to
- 4:23find out which attributes we record in
- 4:26the database
- 4:27we need to make computer science
- 4:30decision as to how the
- 4:33relational
- 4:34schemas will be interrelated between
- 4:36themselves how the attributes will be
- 4:39distributed
- 4:42and at a last phase
- 4:44we need to also decide on the physical
- 4:47design
- 4:48which will tell us
- 4:50what is the physical layout of the data
- 4:52so conceptual design
- 4:55refined into logical design
- 4:58finalized with physical design is our
- 5:01gross process of design
- 5:04now in this
- 5:06for the conceptual design
- 5:08we primarily follow
- 5:11a model called entity relationship model
- 5:15that tries to identify the collection of
- 5:18entities and relationships
- 5:21an entity is nothing but its is is an
- 5:25object is a thing
- 5:27that is distinguishable from
- 5:30other objects so if i say
- 5:32that
- 5:34student is an entity then a student is
- 5:36distinguishable from
- 5:38another entity course
- 5:42both of them are distinguishable from a
- 5:44third entity instructor and so on
- 5:48so every entity for the purpose of
- 5:50distinction is described by a set of
- 5:53attributes or properties
- 5:56and these
- 5:57entities
- 5:59will
- 6:00have relations between them for example
- 6:03you can say that a course
- 6:04will be attended by students
- 6:08students will be advised by instructors
- 6:12so this
- 6:13attended by advised by these are
- 6:16relationships or association
- 6:18between several entities
- 6:21and the model which represents
- 6:24initially diagrammatically and then
- 6:27in textual form
- 6:29this kind of relationship is known as
- 6:31the
- 6:32entity relationship model or the entity
- 6:34relationship diagram
- 6:37we will then use it to get a relational
- 6:41set of relational schema
- 6:43which subsequently we normalize
- 6:46the normalization is nothing but
- 6:48refinement of the design
- 6:50which improves
- 6:52a design to make it better in terms of
- 6:56correctness in terms of ease of
- 6:58manipulation
- 7:00performance and so on
- 7:02so
- 7:03it basically
- 7:07removes bad designs
- 7:09from the database
- 7:10and
- 7:11converts them into good designs we will
- 7:13talk about this normalization theory
- 7:16later in the course
- 7:18right now we are interested only in the
- 7:21entity relationship model which will be
- 7:23used for conceptual design
- 7:26and then
- 7:27will give us the basis for the logical
- 7:30design in terms of the schemas
- 7:33so let us
- 7:36take a deeper look into the entity
- 7:38relationship model
- 7:40and entity relationship model as i said
- 7:42is developed to facilitate the database
- 7:45design
- 7:47get the overall logical structure it is
- 7:50useful in mapping
- 7:52the meaning and interactions of the real
- 7:54world in terms of certain
- 7:56diagrammatic schemas
- 7:59and it employs three basic concepts
- 8:02entities or entity sets we talked about
- 8:04entities
- 8:06all entities that share the same set of
- 8:09properties like
- 8:10if student is an entity
- 8:12then the collection of student is an
- 8:14entity set a instructor is an entity
- 8:17collection of
- 8:18instructors is an entity set so all
- 8:21entities in an entity set will share the
- 8:23same set of attributes
- 8:26we will have relationship sets which
- 8:28define relationship between multiple
- 8:31entity sets
- 8:33and certainly in the process will use
- 8:34make use of attributes these are the
- 8:36three key components of an er model
- 8:42it also has a er diagram as we will show
- 8:46soon
- 8:48so as already defined entity is an
- 8:50object that exists and is
- 8:52distinguishable from other objects
- 8:55entity set is a set of entities of the
- 8:57same type that share the same properties
- 9:00and an entities is represented by the
- 9:03set of attributes or properties that
- 9:05describe it
- 9:07so when we say instructor for example if
- 9:10we say here these are my attributes
- 9:14you have already
- 9:15learned this in terms of studying sql so
- 9:18it has there has five attributes and
- 9:21these five attributes together
- 9:23or the values of these five attributes
- 9:25for a particular instructor
- 9:27defines my entity set instructor
- 9:30collection of these attributes define my
- 9:32entity set courses so these are my
- 9:34different entity sets
- 9:36that
- 9:37exist that can be defined
- 9:42so a subset of attributes
- 9:45in the entity set
- 9:47forms a key
- 9:49called the primary key
- 9:52which can uniquely identify every entity
- 9:54in that entity set we have already been
- 9:57familiar with this concept of primary
- 9:59key
- 10:00the same concept continues
- 10:03so these are examples of ah entity sets
- 10:06instructor with two attributes and
- 10:08student with two attributes as well
- 10:12a relationship is an association
- 10:15among
- 10:17two or more entities
- 10:20so
- 10:21here we have an entity
- 10:24here shown as a student this is a
- 10:26student entity
- 10:28identified by the student id which is a
- 10:32primary key in the student entity set
- 10:36we have an instance of an instructor
- 10:38entity
- 10:39identified by the
- 10:41id
- 10:42of the instructor einstein
- 10:45which identifies any instructor uniquely
- 10:50and then
- 10:51advisor is a relationship set
- 10:55which relates these two
- 10:57so what i we want to mean is
- 11:01if i say advisor
- 11:03relates
- 11:05four four five five three to
- 11:07two to two to two
- 11:10what i want to mean is
- 11:13peltier the student peltier is advised
- 11:16by the instructor einstein
- 11:19so
- 11:20whenever we relate
- 11:21two or more entity sets like this
- 11:24we get relationships so a relationship
- 11:28is a mathematical relation among
- 11:31more than two or more entities
- 11:33each taken from the entity set so you
- 11:36can see that it can have components e
- 11:38one e two
- 11:39e n n entity sets and
- 11:43each entity e one should belong to
- 11:45entity set capital e one
- 11:47e two should belong to entity set
- 11:49capital e two and so on and is called a
- 11:52relationship we have already seen the
- 11:54advisor relationship as above
- 11:58so here what we show is a relationship
- 12:02advisor by these arrows
- 12:04ah these lines so what he is showing is
- 12:07this connection between these two show
- 12:10that
- 12:11this student is advised by this
- 12:13instructor
- 12:15whereas you can see so crick advises
- 12:18tanaka whereas shankar and zhang
- 12:21both are advised by cuts
- 12:23so
- 12:24this
- 12:25group of associations between
- 12:29instructor and student is a gives me the
- 12:32relationship advisor as to who advises
- 12:35whom
- 12:38a relationship also
- 12:40like the entity sets the relationship
- 12:42also can have some additional attribute
- 12:44for example
- 12:46when i say that crick advises tanaka i
- 12:49may associate an attribute date type
- 12:52attributes at third may 2008
- 12:55to mean
- 12:56that when did this
- 12:59process of quick advising tanaka started
- 13:02we can it can be some other attribute
- 13:04also so all that i am trying to
- 13:06highlight is
- 13:08attributes can be assigned to
- 13:10relationships as well
- 13:14now
- 13:15how will a relationship span out
- 13:19we have said that a relationship must
- 13:20involve two
- 13:22entity sets so primarily relationships
- 13:25are binary it involves two
- 13:27and most ah relationships in most
- 13:30databases are binary in nature
- 13:33but it could be that there are we will
- 13:36see later that there are possibilities
- 13:39of having relationships which are
- 13:41ah
- 13:42more than binary ternary and higher
- 13:45so
- 13:46here are examples students work on
- 13:48research projects under the guidance of
- 13:51an instructor
- 13:53so here we have as you can see students
- 13:57research projects and instructors so
- 13:59there are three entity sets so if i want
- 14:01to maintain a relationship of say
- 14:04project guidance between them then that
- 14:06turns out to be a ternary relationship
- 14:09we will talk about this more later
- 14:14there are constraints in terms of the
- 14:17cardinality of the relationship
- 14:20the cardinality basically talks of that
- 14:23when we have
- 14:24when i have
- 14:29a relation entity set e one
- 14:31and identity set e two
- 14:34so there are different entities
- 14:36in them
- 14:37and i have
- 14:39different
- 14:40associations between them
- 14:42then the question is
- 14:45how many of
- 14:46the entity of one entity set is related
- 14:49to how many of the entities of the other
- 14:51entity set
- 14:54and
- 14:54certain types of cardinality measures
- 14:57are very important to track
- 15:00and
- 15:00we say it is whether it is one to one
- 15:02one to many many to one or many too many
- 15:06so here are the examples or or the
- 15:09schematics so in the first one in the
- 15:11diagram a
- 15:12you see that every entity from the
- 15:14entity set a relates to exactly one
- 15:17entity in the entity set b or you can
- 15:19say at most one entity in the entity set
- 15:21b
- 15:23similarly every entity in entity set b
- 15:25relates to exactly one entity in
- 15:28entities at a or at most one entity in
- 15:30entities at a
- 15:31if this holds then we say this
- 15:33relationship is one to one
- 15:36whereas in diagram b you see that a 1
- 15:39relates to b 1 as well as b 2 a 2
- 15:41relates to b 3 as well as b 4. so one
- 15:44entity in a relates to more than 1
- 15:47entity may relate to more than 1 entity
- 15:49in b but
- 15:51if you look from b side
- 15:53every entity in b is related to at most
- 15:56one entity in a
- 15:58then we say from a to b it is one to
- 16:00many
- 16:02now naturally since i can put the
- 16:04relations in any order
- 16:06ah as we have one too many if you look
- 16:09in the other direction it becomes many
- 16:11to one so many to one is from a to b
- 16:14many to one is where more than one
- 16:16entity in set a may relate to one entity
- 16:18inside b but all entities in set b
- 16:21relates to at most one entity inside a
- 16:24and when there is no restriction at all
- 16:26that is any number of entities in set a
- 16:28may relate to any number of entities in
- 16:30set b
- 16:32and
- 16:32any number of entities in set b may
- 16:35relate to any number of entities in set
- 16:36a we say it is a many to many relation
- 16:39so we have one too many one to one we
- 16:42have one too many and many to one and we
- 16:44have many too many and it often helps in
- 16:46the design to be able to characterize
- 16:48which type of relationship we do have
- 16:52coming to the attributes we can note
- 16:54that attributes are of different types
- 16:56one is they could be simple or composite
- 16:58a simple attribute is just
- 17:00one single domain value like a salary
- 17:03number like an id like a name string and
- 17:06so on
- 17:06whereas a composite attribute
- 17:09may comprise of multiple
- 17:11parts
- 17:13so
- 17:15consider this this is a composite
- 17:16attribute so name is an attribute if i
- 17:19think of
- 17:20then it has different parts it has a
- 17:22first name middle name last name if i
- 17:25think of address
- 17:26it has so many different parts then
- 17:28street itself has so many different
- 17:29parts
- 17:30so whenever an attribute is
- 17:33comprise
- 17:34some
- 17:36more of the components when it is not a
- 17:39simple value then it is called a
- 17:41composite attribute
- 17:43we will see how to handle that
- 17:46then some attributes may be single
- 17:48valued for example a person has a has
- 17:50one name let us say
- 17:52but has one address
- 17:55but may have two or more phone numbers
- 17:58the attributes which can take more than
- 18:00one value is known to be multi valued
- 18:02attribute
- 18:04so we also need to specify whether
- 18:06certain
- 18:08specify in the design whether certain
- 18:10attributes are single valued or multiple
- 18:12valued multi valued of course single
- 18:15valued attributes are easy to deal with
- 18:16if it is multivalued we need to do some
- 18:18design changes
- 18:21certain attributes can be derived
- 18:23for example age
- 18:25now i cannot keep the age of some a
- 18:28person in the database because with
- 18:30every day the age changes
- 18:32so what will typically keep is the date
- 18:34of birth and the age is computed
- 18:37on the day when the particular query is
- 18:41made to find out what the edge is
- 18:43so it is called a derived attribute and
- 18:45each one of them will have corresponding
- 18:47set of domains
- 18:51some attributes in the design may turn
- 18:53out to be redundant also consider this
- 18:56you have already seen this this is an
- 18:58instructor
- 18:59which has a department name along with
- 19:02the different attributes and certainly i
- 19:04have a department table
- 19:07so which department relation which gives
- 19:09the details of the department now
- 19:12since every instructor belongs to a
- 19:14department so naturally
- 19:17we might want to have a
- 19:22relation ins
- 19:24department
- 19:26which could give
- 19:27the instructor and
- 19:29his or her department name
- 19:32so if we maintain that
- 19:34then
- 19:35this becomes
- 19:36a redundant attribute
- 19:38this is not required
- 19:40because it that information is already
- 19:42there in this relation
- 19:45so
- 19:46in several cases there is a question of
- 19:49whether
- 19:50we maintain some information in terms of
- 19:53a relation
- 19:54or
- 19:55we can
- 19:57make that
- 19:59directly include that directly in the
- 20:02entity set
- 20:04and get rid of that relation so if i
- 20:06have
- 20:07the ins depth relation
- 20:09and then the attribute department name
- 20:11appears on both these sets
- 20:14instead as well as on the
- 20:17instructor and there is duplication
- 20:20replication of the data which we would
- 20:21want to avoid
- 20:24but we will see the different cases when
- 20:27which style of design whether we would
- 20:29be better to maintain the department
- 20:31name as a part of the instructor
- 20:35relation or it would be better not to
- 20:37have it there and have a separate
- 20:39relation which maps instructor id
- 20:42against the department name
- 20:46finally comes a concept of
- 20:48weak entity sets you need to understand
- 20:50this a little bit consider the
- 20:53university database example
- 20:56so we have courses
- 20:58we have students
- 21:01we have ah
- 21:03instructors
- 21:05and we have section
- 21:07a section is
- 21:09if a course is large
- 21:11then
- 21:12it needs to be taught in multiple
- 21:15sections
- 21:17so for the same course at the same
- 21:20semester in the same year i may have
- 21:23different sections
- 21:24in which the students are divided and
- 21:26naturally there could be multiple
- 21:28instructors
- 21:30each teaching
- 21:32one section of that course and students
- 21:34will be distributed
- 21:36on the sections not on the course
- 21:39now consider this section entity if you
- 21:41look into this then
- 21:43this is how
- 21:44what we we maintained we did a course id
- 21:48semester year and section id
- 21:51but
- 21:52if you look into specifically
- 21:54and if you want to now no you know that
- 21:58there is a section and there is a course
- 22:00so you may want to
- 22:04relate these two
- 22:10section with the course
- 22:13and
- 22:14set up an entity between them
- 22:17so what will it relate
- 22:18it will relate
- 22:20the course id of the course with all of
- 22:23these
- 22:24but the course id is already there as a
- 22:26part of the section
- 22:28right
- 22:30so you would say that well it is not
- 22:32required to have the course id
- 22:35ah since it already has that and it
- 22:40identifies it
- 22:42so
- 22:44we can can we remove this
- 22:47course id
- 22:49from here
- 22:52well if we remove the course id now we
- 22:54have a different problem
- 22:56if you remove the course id
- 22:58then you have section id semester and
- 23:00year but this does not uniquely
- 23:03represent the tuples of this relation
- 23:07because
- 23:08there could be two section is
- 23:11in the same semester in the same year
- 23:14for two different courses how do you
- 23:16distinguish them
- 23:19so
- 23:22you get into a situation where
- 23:25the
- 23:26course
- 23:27the section
- 23:31gets
- 23:32identified
- 23:38uniquely
- 23:40provided
- 23:42either you know
- 23:43the relationship between the
- 23:45section
- 23:47and the course
- 23:49in terms of the sec course relationship
- 23:52or you include the primary key
- 23:56of course
- 23:57into
- 23:59the
- 24:01relation section which we did in the
- 24:03design
- 24:06and this is not a coincidence this is
- 24:08something which happens regularly
- 24:10and
- 24:11is
- 24:13is a characteristics
- 24:15that
- 24:16specify the existence of weak entity
- 24:20sets
- 24:22so
- 24:24the weak entity set
- 24:26is one
- 24:28whose existence depends on another
- 24:30entity set so if i just say section
- 24:33having section id year and semester then
- 24:36it is not uniquely specified until
- 24:41i have a relation
- 24:42section course which relates the section
- 24:46to the particular course id
- 24:49when such relationships are used to
- 24:52identify entities of a particular entity
- 24:55set
- 24:56then
- 24:58the unique side the core side which is
- 25:01unique
- 25:02is known as the identifying entity
- 25:05and the other attributes
- 25:08in this case section id year
- 25:10semester are known as the discriminators
- 25:14so we have a relationship
- 25:17between a weak entity set
- 25:26which is section
- 25:29we have a strong entity set which is
- 25:31course
- 25:32why is it strong because course is
- 25:34identified by course id itself
- 25:37section is not
- 25:39unless
- 25:41you have a
- 25:42sec course
- 25:44kind of
- 25:46relationship
- 25:48set between the course and the section
- 25:50which specifies that well
- 25:52for this course this is the section this
- 25:54is the here this is the semester
- 25:58so
- 25:59this is the identifying entity through
- 26:01which
- 26:02the entities of this set
- 26:05gets
- 26:06specified
- 26:08and whenever that situation happens
- 26:11then
- 26:12we say that we have a weak entity set
- 26:17so weak entity sets naturally cannot
- 26:19happen by themselves
- 26:21they are existence dependent on
- 26:24identifying entity set
- 26:27and the identifying entity set
- 26:30owns the weak entity set so the courses
- 26:32in that way own
- 26:34the section
- 26:36and
- 26:37the identifying relationship between
- 26:40them
- 26:40is
- 26:41necessary to uniquely identify every
- 26:45entity
- 26:46of this weak entity set or section in
- 26:49our case
- 26:50so this notion is ah very important for
- 26:54the design as we will see
- 26:57that the relational schema that we
- 26:59eventually created in this case
- 27:01from the entity set section
- 27:04we did include course id
- 27:08as a part of the primary key
- 27:12not using
- 27:13the
- 27:15sec course kind of relationship and we
- 27:17will show
- 27:18how this design style for
- 27:21dealing with entity weak entity sets
- 27:24influences the different database
- 27:27designs
- 27:28so weak entity sets are critical notions
- 27:30that you need to be
- 27:32aware of need to be confident of
- 27:37so in summary
- 27:38we have introduced the design process
- 27:40for database systems i will just quickly
- 27:43recap
- 27:44the first stage is identifying the data
- 27:46items which is leading to the conceptual
- 27:49design
- 27:51which will primarily do in terms of the
- 27:53entity relationship model identifying
- 27:55the entities the entity
- 27:58sets
- 27:59the attributes that
- 28:01define the entity set describe the
- 28:03entity set
- 28:04the subset of attributes forming primary
- 28:07key that uniquely specifies every entity
- 28:09set
- 28:10every entity in the entity set
- 28:13and the relationships typically binary
- 28:16may be non-binary also
- 28:18relationships that hold between the
- 28:20different entity sets
- 28:22so this is the conceptual design that
- 28:25will lead to
- 28:26more detailed logical design of
- 28:29how the relationship should be organized
- 28:31what is the cardinality of that what
- 28:34kind of attributes do i have whether it
- 28:36is simple whether it is composite
- 28:38whether
- 28:40certain attributes are
- 28:42derived or not so all those ah different
- 28:46aspects will have to be detailed out
- 28:48and
- 28:49we need to identify what are the weak
- 28:51entity sets and what are the strong
- 28:53entity sets what are the identifying
- 28:56entities
- 28:57and
- 28:59with that we could complete the logical
- 29:02design
- 29:03and then we will need to make it
- 29:06in terms of a express it in terms of a
- 29:08relational schema
- 29:10so
- 29:11in this module we have just taken a look
- 29:13in the first part the entity
- 29:14relationship model
- 29:16and the
- 29:17very basic of how the conceptual design
- 29:20will go forward
- 29:22in the model we have seen all the
- 29:24different primitives required to
- 29:26represent the reality represent what
- 29:29holds in the real world
About this transcript
This page contains the full transcript of Entity-Relationship Model/1 by Data Base Management System - IITKGP, generated from the public captions YouTube serves with the video. The transcript has 3,649 words across 750 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.