0

How to draw the ER diagram of below mentioned scenario?

Scenario: Users can asks questions according to subjects they have enrolled, and as well as answer to those questions. So basically Users can ask questions belongs to subjects and Users can answer to those asked questions.

In my diagram I have 3 entities, those are User and Question, and Subject. And Answer will be a derived attribute of the relationship between User and Question entities. And Question belong to a Subject.

My question is can Question be introduced as an Entity to the ER diagram or not?

When thinking about the definition of the Entity, I feel Question cannot be introduced as an Entity to the ER diagram.

If then, how Question can be introduced to the ER Diagram?

Is below er diagram is correct or wrong? enter image description here

1 Answers1

0

I don't know how you structured your database. You can use loop in this case. Group of users are the one who asks as well as answers question. It is a m:n relationship. You can add subject as descriptive attribute. It is hard to answer without knowing the entire database structure. I hope it can give you some ideas. ER diagram

Manoj Bhat
  • 136
  • 1
  • 11
  • If there is another entity called **Subjects** how would you map? So the scenario I can change like users can ask questions according to subjects. I will update my questions with that additional information so it's clear. – Saajidh Borham Jan 01 '23 at 15:41
  • Can I do 1 way relationship between **User** and **Subject** entities without loop or a circular logic and question and answer will be derived attributes of that relationship? So between those relationship there will be m:n cardinality. Since it has m:n cardinality it will create a new table and in that new table I can add Question and Answer attributes since they are derived attributes. – Saajidh Borham Jan 01 '23 at 18:48
  • You can do it in that way but that will not be a 1 way relationship but many to many relationship. – Manoj Bhat Jan 02 '23 at 03:37
  • Your ER diagram is correct if you don't want to use circular logic then go with your diagram. – Manoj Bhat Jan 03 '23 at 08:36
  • Thanks, Then I'll go with my diagram. Just in the background I'm looking whether my diagram can draw with associative entities as well. If you think there is a possibility to do my diagram in more refiner or in a better way with associative entities, let me know. – Saajidh Borham Jan 06 '23 at 04:36