Questions tagged [entity-relationship]

An entity-relationship model (ERM) is an abstract and conceptual representation of data, information aspects of a business domain or its process requirements. Ultimately ERM is being implemented in a database.

Entity-relationship modeling is a database modeling method, used to produce a type of conceptual schema or semantic data model of a system, often a relational database, and its requirements in a top-down fashion. Diagrams created by this process are called entity-relationship diagrams, ER diagrams, or ERDs.

The main components of the ER diagrams are the entities and the relationships that exist among them. For example with the original notation, in the relational databases tables are shown as boxes, its attributes as ovals and their relations with other tables with lines.

The three schema approach to software engineering uses three levels of ER models that may be developed:

  • Conceptual data model is the highest ER model, that contain least granular detail but establishes the overall scope of what to be included in the model set.

  • Logical data model contains more detail than the conceptual ER model. Operational and transcational data entities are defined.

  • Physical data model - one or more such models can be developed from each logical ER model. Normally developed to be instantiated as a database, therefore each physical model must contain enough detail to produce a database.

2962 questions
11
votes
1 answer

How to export ERD diagram to image in oracle data modeler/sql developer

I'm on oracle sql developer 4.0.2.15. I used data modeller to generate Entity Relationship Diagram, how to save it as image? I need it to create documentation for my project.
11
votes
3 answers

How is a context diagram different than a level 0 diagram?

What is the difference, if any, between a context diagram and a level 0 diagram?
Celeritas
  • 14,489
  • 36
  • 113
  • 194
10
votes
2 answers

How to emulate "extending a class" with database tables?

I will have several different types of users that will use my system. For all users I need to store such things as username, password, email address, etc, but if they are a user of category A, I also need to store values for fields a, b, and c, but…
NightHawk
  • 3,633
  • 8
  • 37
  • 56
10
votes
3 answers

Generating entity relationship diagram in Visual Studio 2015

Can you tell me how I can generate an ER diagram for my database1 (see below) created with VS 2015 Thanks in advance
10
votes
3 answers

What is the difference between an entity relationship model and a relational model?

I was only able to find the following two differences: The relationships in an E-R model are explicitly defined, while they are implicit in a relational model. Relational models require an intermediate table (often called a "junction table") to…
Shailesh
  • 2,116
  • 4
  • 28
  • 48
10
votes
5 answers

2 relationships between 2 entities in ER diagram

I'm trying to draw an ER diagram describing the following: -"Department" employs "Employees" -Some "Employees" are "Special" and have more attributes -Some of the "Employees" ("Special" and non special) are "Managers" -"Managers" manage…
9
votes
5 answers

Can I disable automatic relationships in Entity Framework Code First?

I noticed that Entity Framework still has a lot of "automagical" features in their latest release. As always, this is a truly double-edged sword. Specifically, I'm using the OnModelBuilder event to create my model on the fly in code using the…
Brett
  • 4,066
  • 8
  • 36
  • 50
9
votes
2 answers

Notify parent Entity when child Relationship Entity changes in Core Data

Is it possible to receive a callback or notification in the parent Entity when any one it's relationship objects changes? This works great when an attribute of the Entity changes. The following method... - (void)didChangeValueForKey:(NSString *)key…
Nate Potter
  • 3,222
  • 2
  • 22
  • 24
9
votes
2 answers

implementing Posts, comments, and likes in DB

I am trying to model a DB in Postgresql after a social media platform such as twitter and Instagram. I have the following requirements: A user can create a Post A User can Like a Post A user can comment on a Post A user can comment on another users…
9
votes
1 answer

pgadmin 4 (or db visualiser) entity relation diagram

How do you make an entity relation diagram using pgAdmin v4 or DB Visualizer or any other open source tool? PG Admin There are lots of explainers for pgadmin III but they suggest that there should be a tab called 'graphical query builder under the…
Mel
  • 2,481
  • 26
  • 113
  • 273
9
votes
1 answer

Decomposing a ternary relationship into binary relationships

I am designing a database that handles users, accounts and projects with the following relationships and constraints: An account has many users A user belongs to many accounts An account has many projects A project belongs to only one account A…
elitalon
  • 9,191
  • 10
  • 50
  • 86
8
votes
2 answers

Can I set an entity relation with just the ID?

I have a JPA (Hibernate) entity: @Entity class Transaction { @ManyToOne private Room room; } When I create a new Transaction, I know the ID of the Room that it should refer to (but don't have a Room object). Can I somehow create and persist a…
Bart van Heukelom
  • 43,244
  • 59
  • 186
  • 301
8
votes
1 answer

EF Code First - Fluent API (WithRequiredDependent and WithRequiredPrincipal)

I have the following class: public class User { public Guid Id { get; set; } public string Name { get; set; } public Couple Couple { get; set; } } public class Couple { public Guid Id { get; set; } public User Groom { get; set;…
ridermansb
  • 10,779
  • 24
  • 115
  • 226
8
votes
3 answers

Database Design for a Multiplayer/Single Quiz game

I saw a lot of questions here but no one fits with my problem. I'm trying to create an ER model scalable, and if I want to add more data don't break almost anything, so what I've trying to create is : There are 2 types of users, let's say Admin and…
8
votes
2 answers

How to handle Many to Many relationship in mongoDB?

I have a specific problem with many to many relationship implementations in MongoDB. I have collections of Songs and Artists(Millions document). Here the song can be sung by Many Artists and an artist can sing Many songs. So I followed the approach…
Abhishek Singh
  • 1,631
  • 1
  • 17
  • 31