in this video let us learn to draw the er diagram for hospital management system topic so the first step is we need to choose the entities entity means object with physical existence or conceptual existence so entity means it should be an object so in hospital there will be doctors and patients will go and visit doctors next the patient will go and buy the medicine from the medical shop so doctor is physically existing therefore it is an entity patient is also a person and patient is physically existing therefore it is also an entity next medicine medicine you cannot say that it is physically existing but the patients go and buy the medicine so therefore it is conceptually existing so therefore medicine is also an entity entity must be written inside a rectangular box so we need to draw three rectangular boxes so over here i'm going to draw my first rectangular box and write doctor inside it next i'm going to draw the second rectangular box and write my second entity name which is patient third rectangular box and write medicine so the three entities are doctor patient and medicine therefore i have written it inside the rectangular box the second step is i should write the attributes associated with the entities attribute means characteristics of entity an attribute must be written inside oval so first if you take doctor will have a name the characteristic of doctor so doctor will have a name so all the attributes must be written inside an oval so name this name can be further divided as first name middle name and last name i can call this attribute name as composite attribute composite attribute means i'll be able to divide it further i'm able to divide this name further as first name middle name and last name therefore this name is a composite attribute okay what are the other attributes associated with doctor let us see that now next doctor will have an id so doctor's id doctor id so i should underline this word doctor id because doctor id is a primary key i should write the attribute inside the oval and then i should underline the primary key because doctor will have only one id and that same id no other doctor will be having or no other person will be having that id will be unique for each and every doctor so therefore this is a primary key so i have underlined next doctor will have an address next doctor will have a phone number i should write this phone number inside double oval because this phone number is multi-valued attribute multi-value attribute means this doctor can have more than one phone number also it is not that this doctor will be having only one single phone number so this doctor can have more than one phone number therefore this is a multi-value attribute and that's the reason why i have written this phone number inside double oval so these are all the attributes of the entity doctor next attributes of the entity patient patient will have a name and that will be further divided as first name middle name and last name so again over here name is a composite attribute because we're able to divide this attribute further as first name middle name and last name next again patient will also have an id that is patient id so this must be underlined because this is a primary key so this id will be unique for each and every patient next again patient will also have an address next patient will also have a phone number so the pa this should be written inside double oval again over here phone number is multi-valued attribute patient can have more than one phone number so these are all the attributes of the entity patient next for the entity medicine what are all the attributes quantity quantity of the medicine next price of the medicine so what is the cost of the medicine which the patient has bought next how much quantity is needed so those two are the attributes related to the entity medicine now i should join the entities joining the entities can be done only by using relationship means you should draw the diamond shape so i should draw the diamond shape so these two are the entities doctor and patient so i'm joining those two next patient and medicine are two entities i'm joining those two using the diamond shape so this diamond shape is known as relationship so inside this diamond shape i'm going to write treats so doctor treats patient so doctor will treat patient after treating the patient the patient will go and buy the medicines so bill so the patient will go and buy the medicines and pay the bill so this is the flow the doctor will treat the patient after treating the patient the patient will go and buy the medicine which the doctor has told so this is the flow so doctor patient and medicine are the entities and all these ovals are your corresponding attributes and these diamond shapes are the relationship connecting two entities so that's all so this is the er diagram of hospital management system if you like this video please like subscribe and share it with your friends thank you