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
7
votes
4 answers

The correct way of storing document reference in one-to-one relationship in MongoDB

I have two MongoDB collections user and customer which are in one-to-one relationship. I'm new to MongoDB and I'm trying to insert documents manually although I have Mongoose installed. I'm not sure which is the correct way of storing document…
Sithu
  • 4,752
  • 9
  • 64
  • 110
7
votes
2 answers

JPA - Entity design problem

I am developing a Java Desktop Application and using JPA for persistence. I have a problem mentioned below: I have two entities: Country City Country has the following attribute: CountryName (PK) City has the following attribute: CityName Now…
Amit
  • 33,847
  • 91
  • 226
  • 299
7
votes
1 answer

Undelete an entity marked as EntityState.Delete?

instead of talking let me talk with code: Dim Contact = Context.Contacts.Include("Phones") Dim phone = Contact.Phones(0) Contact.Remove(phone) How do I refresh the context now, canceling last relation deletion? I…
7
votes
4 answers

How can triggers and stored procedures be represented in an ER Diagram?

Is it a good idea to show triggers and stored procedures in an Entity Relationship Diagram? If yes, what is the notation? Information seems really scarce on this topic. Also, are there any UML diagrams you would use to represent triggers?
David
  • 15,652
  • 26
  • 115
  • 156
7
votes
3 answers

How to correctly organize structure of two enums with relationship many-to-many between them in terms of application's architecture and classes?

I have enum CarBrand: public enum CarBrand { BMW, MERCEDES, VOLKSWAGEN, AUDI, FORD, OPEL } and enum CarBodyType: public enum CarBodyType { SEDAN, MINIVAN, VAN } Relationship between them is many to many. I.e. a car brand can have several…
François Esthète
  • 855
  • 2
  • 9
  • 15
6
votes
1 answer

Followup: how to model discount on items in a database?

I am building an ecommerce site and would like to offer discounts on certain items for a limited time. I would like to display how much discount we are offering per product. Hence, I need two values per product, original price and the discounted…
brainydexter
  • 19,826
  • 28
  • 77
  • 115
6
votes
1 answer

Django admin - autocomplete(_field) without foreignkey or manytomany relationship

I was wondering whether there is a function which lets me implement an autocomplete_field without having this variable be linked to another relation via a foreign key. I.e. I have the models Aaa, Bbb, & Ccc. Bbb & Ccc are related using a foreign…
6
votes
1 answer

Performance: Core Data relationships get faulted after being assigned

I have a Core Data model representing a TV guide on iOS 4+, with 3 classes: Channel (BBC 1) Program (Top Gear) Broadcast (Top Gear on BBC 1 on Monday at 8pm) I have about 40 channels, 8000 programs and 6000 broadcasts, and I would like to…
ndfred
  • 3,842
  • 2
  • 23
  • 14
6
votes
5 answers

How to create E-R diagram in mysql

I am using MySQL. There are 28 tables in my database. I've tried to use MySQL Workbench to create E-R diagram. As there are 28 tables, everything is messed up in diagram using MySQL Workbench. Is there any way to create E-R Diagram which shows all…
bsm
  • 1,793
  • 11
  • 30
  • 41
6
votes
3 answers

Add/Remove many to many associations in Entity Framework

I have three tables in my sample database: Users ID Username Password Roles ID Name Description UserRoles UserID RoleID UserRoles is a lookup table to simulate a many to many relationship. Adding records to this table allows one to associate…
CatDadCode
  • 58,507
  • 61
  • 212
  • 318
6
votes
2 answers

Modeling a one-to-many relationship in Core Data for iOS

I have two entities: patient and checkpoint. Patient has attributes such as DOB, name, ID, etc. Checkpoint has attributes such as dateRecorded, height, weight, etc. You probably get the idea- I want there to be a set of patients, and then each…
Josh Sherick
  • 2,161
  • 3
  • 20
  • 37
6
votes
1 answer

How can I insert Foreign Key(FK) in starUML ER diagram?

I'm working on a ER diagram in starUML but can't find a Foriegn Key option in it. I've looked through various setting in the application but couldn't find it. Is they a way to insert? Also, I've seen images using FK in starUML but couldn't find out…
Harsha Murupudi
  • 579
  • 1
  • 6
  • 19
6
votes
3 answers

Maximum Constraint on One to Many Relationship - Oracle SQL

Using Orcale SQL developer I want to map out a relationship between an employee and manager. However, a manager can only supervise a maximum of 3 employees. Above I have an employee table with Manager ID as a foreign key. This has a one to many…
6
votes
2 answers

remove foreign key property cause an exception

I don't want to use foreign key association to CompanyType (member that will hold the foreign key id) but prefer to use navigation property. So I removed the CompanyTypeId. I get this exception that relates the relationship between entity Company…
Naor
  • 23,465
  • 48
  • 152
  • 268