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

Liferays Service Builder - many-to-many relations

I'm trying to create a many-to-many between my own entity and the liferay Group entity. My service.xml looks like this
onigunn
  • 4,730
  • 10
  • 58
  • 89
5
votes
2 answers

How do you work with Entity relationship within Doctrine 2?

When you want to insert an Entity you do this: $user = new User(); $user->setEmail('john@doe.com'); $em->persist($user); $em->flush(); But what if I want to create an article which can have one User; Currently, I need to do: $user =…
JohnT
  • 967
  • 2
  • 16
  • 30
5
votes
1 answer

Fluent NHibernate - Flatten multiple rows into a single entity

I have a database table that I cannot change which contains data like: FooTable Id | EntityAUniqueId | EntityBUniqueId | EntityCUniqueId ============================================================ 1 | A1 | B1 |…
Bronumski
  • 14,009
  • 6
  • 49
  • 77
5
votes
3 answers

Laravel many-to-many relation with custom table names and IDs

Hello so I have many to many relation between Question [table name: tblquestion, id: que_id] and Agecategory [table name: tblagecategory, id: aca_id]. They have shared table named QuestionAgecategory [table name: tblquestionagecategory, id: qac_id].…
Tinabot
  • 399
  • 1
  • 4
  • 14
5
votes
1 answer

How do I create two associated entities at one time with EF4 Code-First

So Say I have 2 entities, Post and PostHistory. Whenever I create or edit a post, I want to create an exact copy of it as PostHistory to log all changes made to a post. Say the post entity has the following definition: public class Post { …
KallDrexx
  • 27,229
  • 33
  • 143
  • 254
5
votes
2 answers

Save a relation with between two entities an N-N association

I've a Entity Framework 4.0, with poco object. the edmx model file is generated from the database. This datacontext is accessed through WCF service, it's only mean that I receive some objects and I need to attach them to the current datacontext(or…
J4N
  • 19,480
  • 39
  • 187
  • 340
5
votes
1 answer

Foreign keys depend on the column content - how to ensure integrity?

Short introduction – logic behind the data I am working on a PostgreSQL database that stores experimental data (Raman spectra) and their metadata. It is necessary, in addition to the "normal" spectra of our samples, to acquire and save special…
5
votes
2 answers

Difference between owned one to many relationship and owned one to many bidirectional relationship(Google App Engine Java Api)

what is the difference between owned one to many relationship and owned one to many bidirectional relationship i read the article below but i don't understand it. Article
5
votes
1 answer

How to create Lookup table and define relationships

As you can see at below, there are a Lookup table for the enum values and I want to create a relationship between a table's enum values and LookupKey column of the Lookup table (instead of ID column of the Lookup table). Lookup table: ID |…
5
votes
1 answer

Entity framework POCO

What does one loose by creating POCO using T4 templates in entity framework 4.0? Why is the default behavior when using entity framework 4.0 not to create POCO?
rkrauter
  • 1,159
  • 1
  • 11
  • 23
5
votes
1 answer

Database of bank accounts

I'm creating a database for a 'bank' and was just unsure as to whether my method of attaching accounts to customers was the most efficient. Here are a few of the enterprise rules: -there are 2 types of account (current and savings) -each account…
5
votes
2 answers

phpmyadmin 3.4.0 ERD to PDF

I can create an ERD in phpmyadmin 3.4.0 with the Designer tool, but how do I export it as a PDF? I can see the [Import/Export coordinates for PDF schema] button, but cannot see what it does, or how to get a PDF of my ERD. Thanks in advance.
comeback4you
  • 716
  • 1
  • 8
  • 24
5
votes
3 answers

Entity Relationship Diagram for MS Access

I've worked with MySQL and MSSQL for some time and have used a variety of CASE and UML tools when designing some of my more complex projects. I was recently asked by a colleague if I could provide an Access database for his department. The…
5
votes
8 answers

Design question: Filterable attributes, SQL

I have two tables in my database, Operation and Equipment. An operation requires zero or more attributes. However, there's some logic in how the attributes are attributed: Operation Foo requires equipment A and B Operation Bar requires no…
a paid nerd
  • 30,702
  • 30
  • 134
  • 179
5
votes
6 answers

Should I use an index column in a many to many "link" table?

I have two tables, products and categories which have a many to many relationship, so I'm adding a products_categories table which will contain category_id and product_id. Should I add another (auto-incrementing) index column or use the two existing…
Matteo Riva
  • 24,728
  • 12
  • 72
  • 104