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
1 answer

standard file format(s) to represent database schemas

Is there any standard or at least very common file format to serialize the schema of a database? It seems that every db schema tool comes with its own file format for this to list tables, their columns, indexes and the rest. This question has been…
5
votes
1 answer

Insertion when both sides are mandatory in entity relationship

I am preparing for an exam from databases and there is this one thing that puzzles me. From what I've read both sides of any relationship can be constrained to be NOT NULL. I've seen it in at least 2 books and various articles. Nobody however…
Honza Brabec
  • 37,388
  • 4
  • 22
  • 30
5
votes
2 answers

Hibernate select before update

In my work i'm using spring with exidirect, hibernate on the server side and extjs on client side. When i post a form, on the server side spring converts it to the entity. Entity has a id field, that supposes update operation. I'm calling service…
Damask
  • 1,754
  • 1
  • 13
  • 24
5
votes
1 answer

solution for single attribute in table

I am designing database architecture. I have user. User make request for order. Order is associated with payment. Once payment is completed, I want to generate sticker for that user. Sticker has initial prize(i.e. $10). Now, admin can edit sticker…
Ketan Ghumatkar
  • 720
  • 7
  • 14
5
votes
3 answers

relationship and build database

For an excercise I need to build something like : For a course I need to create a review that is made up out of certain reviewlines and feedbackscores. This review object (unique instance) needs to be filled in by a list of customers. Depending on…
Darth Blue Ray
  • 9,445
  • 10
  • 35
  • 48
5
votes
1 answer

Grails Many-To-Many and One-To-Many clash

I have the following two domain classes, User and Posts And I have two relationships between them, User has 1-to-many with Posts with back reference. User has many-to-many relationships with posts that he follows: The relationships I've got are as…
5
votes
1 answer

How to define nested Identifying Relationships Entity Framework code first

I'm using EF5 code first in a simple test application at the moment to test various functions. I have defined an 'identifying relationship' between two entities which represent a one-to-many link. Here I define a PhotoCollection that has many child…
5
votes
2 answers

Issue in EF, mapping fragment,no default value and is not nullable

I am developing MVC 3 Applicaiton. I have Model first approch. I have Company Entity(Abstract). Lead and Customer is inherited from the company entity. When I tried to validate the model, Its gives an errror. Error 41 Error 3023: Problem in…
5
votes
1 answer

Core Data multithread store relations

my problem is very strange and I am asking for help. I want to explain to you how my system works. I have two problem with this. I am making application which have two tables. I am using core data. Tables are Categories and Products, in core data I…
5
votes
3 answers

Symfony2 - Notice: Undefined offset: 0 due to a custom Query

I have this error : "Notice: Undefined offset: 0 in C:\wamp\www\Videotheque\vendor\doctrine\lib\Doctrine\ORM\QueryBuilder.php line 240" I am creating a video collection online. There are 2 entities : Film and Genre. In my…
Adrien G
  • 1,086
  • 2
  • 14
  • 32
5
votes
1 answer

Multiple one to many relationships with Entity Framework

I am using EntityFramework 4.1. I have the following model: public class User { [Key] public int Id { get; set; } public string Username { get; set; } public string Password { get; set; } public virtual User Creator { get; set; } …
5
votes
3 answers

CakePHP multi-model view

I am creating a website in CakePHP and I am kind of new on it. I couldn't find good resources on this matter, so there you go: I have a three table structure for registering users: Users, Addresses and Contacts. I have to build a view with info of…
Fernando Barrocal
  • 12,584
  • 9
  • 44
  • 51
5
votes
2 answers

Relationship on same table with Entity Framework

How can I specify a realtionship on the same table using Entity Framework? My table 'Items' has the following fields: - Id (uniqueidentifier) - ThreadId (uniqueidentifier) - Created (datetime) - Text (nvarchar(max)) My model 'Item': - Id (Guid) …
5
votes
6 answers

SQL Delete if the row is not affected by constraints

First note that I have seen this question:TSQL delete with an inner join I have a large table and several foreign key relations, each of which have data of a given age. We need to remove data older than a given data on a regular basis to stop the…
Spence
  • 28,526
  • 15
  • 68
  • 103
4
votes
1 answer

How to specify relationship name in code-first many to many relationship

When I create two entities with many to many relationship, it will generate a relationship table in the database, is it possible to specify the table's name?
James
  • 2,570
  • 7
  • 34
  • 57