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
440
votes
9 answers

How to generate an entity-relationship (ER) diagram using Oracle SQL Developer

I want to use Oracle SQL Developer to generate an ER diagram for my DB tables but I am new to Oracle and this tool. What is the process for creating an ER diagram in SQL Developer?
Breezescut
  • 4,501
  • 3
  • 15
  • 4
350
votes
7 answers

How can I handle many-to-many relationships in a RESTful API?

Imagine you have two entities, Player and Team, where players can be on multiple teams. In my data model, I have a table for each entity, and a join table to maintain the relationships. Hibernate is fine at handling this, but how might I expose…
Richard Handworker
  • 3,579
  • 3
  • 15
  • 6
246
votes
5 answers

Turn off constraints temporarily (MS SQL)

I'm looking for a way to temporarily turn off all DB's constraints (eg table relationships). I need to copy (using INSERTs) one DB's tables to another DB. I know I can achieve that by executing commands in proper order (to not break…
Maciej
  • 10,423
  • 17
  • 64
  • 97
196
votes
4 answers

How to get ER model of database from server with Workbench

Is there any way to get an ER model of a database from the server that is connected to my MySQL Workbench?
zdarsky.peter
  • 6,188
  • 9
  • 39
  • 60
107
votes
4 answers

How can I generate an entity–relationship (ER) diagram of a database using Microsoft SQL Server Management Studio?

I want to generate an ER diagram of an SQL database using Microsoft SQL Server Management Studio (SMSS). However, I don’t know how to. I found this technique online: Making ER Diagram from SQL Server 2008 Database However, I am not able to see…
Temp O'rary
  • 5,366
  • 13
  • 49
  • 109
74
votes
6 answers

How does Hibernate detect dirty state of an entity object?

Is it using some kind of byte codes modification to the original classes? Or, maybe Hibernate get the dirty state by compare the given object with previously persisted version? I'm having a problem with hashCode() and equals() methods for…
Lenik
  • 13,946
  • 17
  • 75
  • 103
63
votes
1 answer

Why should I avoid loops when designing relationships for a database?

Someone told me that it was bad design to have loops in the datamodel. I have heard this before a couple of times but didn't pay much attention. For example you have entities User, Project, Activity. A project is owned by a User, so we have a…
62
votes
2 answers

Django: what is the difference (rel & field)

What is the difference between Django's models.ManyToManyField and models.ManyToManyRel? I'm confused about this stuff.
sultan
  • 5,978
  • 14
  • 59
  • 103
57
votes
7 answers

Azure data studio schema diagram?

I just recently downloaded Azure Data Studio with SQL Server Express since I'm using Linux . Is there an entity-relationship diagramming feature, kind of how SQL Server Management Studio has a database diagram feature? I want to visually see the…
badugi
  • 581
  • 1
  • 4
  • 5
57
votes
3 answers

Hibernate recursive many-to-many association with the same entity

Another Hibernate question... :P Using Hibernate's Annotations framework, I have a User entity. Each User can have a collection of friends: a Collection of other Users. However, I have not been able to figure out how to create a Many-to-Many…
Magsol
  • 4,640
  • 11
  • 46
  • 68
56
votes
1 answer

MapKey vs HasForeignKey Difference - Fluent Api

What is actually the difference between: this.HasRequired(a => a.Something) .WithMany() .Map(a => a.MapKey("SomethingId")); and this.HasRequired(a => a.Something) .WithMany() .HasForeignKey(a => a.SomethingId);
parliament
  • 21,544
  • 38
  • 148
  • 238
49
votes
13 answers

Error 3004: Problem in mapping fragment starting at line

I have this error when I build my Web Service: Error 3004: Problem in mapping fragment starting at line 323: No mapping specified for properties JE_TRN_HS.JE_HDR_HSJE_HDR_KEY. Entity is type [TESTCPModel.JE_TRN_HS This is what happend. I…
44
votes
30 answers

What are some of your most useful database standards?

I have some ideas, some that I have accumulated over time, but I really want to know what makes things go smoothly for you when modeling database: Table name matches Primary Key name and description key Schemas are by functional area Avoid…
Raj More
  • 47,048
  • 33
  • 131
  • 198
42
votes
4 answers

High-quality ERD generator for PostgresQL under Linux?

Background MySQL Workbench can produce appealing and high-quality ERDs such as: Research What PostgreSQL ERD tools are available that meet the requirements? The following are unsuitable: dbVisualizer - Yellow squares. AquaFold - Yellow…
Dave Jarvis
  • 30,436
  • 41
  • 178
  • 315
41
votes
7 answers

Implementing Zero Or One to Zero Or One relationship in EF Code first by Fluent API

I have two POCO classes: Order Class: public class Order { public int Id { get; set; } public int? QuotationId { get; set; } public virtual Quotation Quotation { get; set; } .... } Quotation Class: public class Quotation { …
Masoud
  • 8,020
  • 12
  • 62
  • 123
1
2 3
99 100