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
6
votes
3 answers

Conditional Relationship in Symfony2

Let's say I have a Post entity, and a Comment entity. A comment can be approved or not by an admin (which is a flag in the db). The post entity has: /** * @ORM\OneToMany(targetEntity="Comment", mappedBy="post") */ protected $comments; And I also…
Thanasis Pap
  • 2,031
  • 2
  • 17
  • 19
6
votes
5 answers

Same fields in most tables

In a database prototype, I have a set of fields (like name, description, status) that are required in multiple, functionally different tables. These fields always have the same end user functionality for labeling, display, search, filtering etc.…
peterchen
  • 40,917
  • 20
  • 104
  • 186
6
votes
5 answers

in a relational database, can we have a table without any relation with the other tables?

in a relational database, can we have a table without any relation with the other tables?
6
votes
2 answers

Translating relationship attributes from ER diagram into SQL

Currently trying to get to grips with SQL for the first time, so I am working through a few problems. Here is a sample database spec: Students (name, gender, course) do projects(title). Each project has two supervisors (name, gender, department).…
Cohagen
  • 87
  • 1
  • 1
  • 8
6
votes
6 answers

a layman's term for identifying relationship

There are couples of questions around asking for difference / explanation on identifying and non-identifying relationship in relationship database. My question is, can you think of a simpler term for these jargons? I understand that technical terms…
6
votes
1 answer

How we identify the relation direction in an ER diagram if we use Chens notation?

How we identify the relationship direction in Chen notation?. If we add A has B relationship then can anyone read it as B has A ?
Sanjaya Liyanage
  • 4,706
  • 9
  • 36
  • 50
6
votes
3 answers

Entity Relation notation in text

Is there a standard (non-graphical) notation for Entity Relationships? right now I'm using my own janky notation: User >> Photo , (1-many) User > Profile , (1-1 hasOne) Profile < User , (1-1 belongsTo) Photo << User , (many-1 belongsTo) Photo <>…
cardflopper
  • 976
  • 2
  • 12
  • 19
6
votes
2 answers

Getting Error 3007 when I add my Entity Model

I am getting an error 3007 when I add my entity model to my solution. I found these links: Good explination Short answer About this error: Error 1 Error 3007: Problem in Mapping Fragments starting at lines 89, 94: Non-Primary-Key column(s)…
johnnywhoop
  • 964
  • 2
  • 7
  • 28
6
votes
3 answers

Entity Relationship diagram from text tool

Is there any ER tool that can generate the model using textual input? I am currently using dia which is an awesome tool, but i am looking for something which accepts text as input. Thanks
Sid
  • 481
  • 1
  • 4
  • 20
6
votes
1 answer

Oracle optional relationship

What is the proper way to define an oracle table who has an optional foreign key relationship with another table? For instance, some employee records have defined the country they are from (a FK from countries table), and some have not.
user112799
  • 1,605
  • 2
  • 13
  • 15
6
votes
3 answers

Standard database neutral XSD to describe a relational database schema

Is anyone aware of a vendor neutral XSD to describe a relational database schema? Our system needs to grab information about the structure of a database: Tables Columns and types Primary and Foreign Keys Constraints Indexes etc in a vendor…
5
votes
1 answer

Entity Framework 4.1 Ghost Columns

I am currently having some issues with EF4.1. The generation of the the SQL doesn't seem to match what I expect to be generated based on my classes. I have the following classes (This is just a smaller set of a bigger collection, however, this is…
David Muir
  • 139
  • 2
  • 6
5
votes
5 answers

How do you model roles / relationships with Domain Driven Design in mind?

If I have three entities, Project, ProjectRole and Person, where a Person can be a member of different Projects and be in different Project Roles (such as "Project Lead", or "Project Member") - how would you model such a relationship? In the…
kitsune
  • 11,516
  • 13
  • 57
  • 78
5
votes
1 answer

EF 4.1 Code First: Each property name in a type must be unique error on Lookup Table association

This is my first attempting at creating my own EF model, and I'm finding myself stuck attempting to create a lookup table association using Code First so I can access: myProduct.Category.AltCategoryID I have setup models and mappings as I…
KDrewiske
  • 1,539
  • 1
  • 16
  • 17
5
votes
2 answers

What is the correct way how to create relation in typeorm?

I have two entities: @Entity({ name: 'provider' }) export class ProviderEntity extends GenericEntity { @Column() name: string; @Column() description: string; @OneToMany(() => ItemEntity, item => item.provider) items:…
lifoyem162
  • 273
  • 2
  • 3
  • 7