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

How to show comments under a post like facebook does?

I'm trying to make a facebook wall-alike php script. It loads the posts stuff, photo url and user stuff like username and user id from my MySQL database. It also checks if the post is just a comment to another post (parentof). I can present all the…
Jussi Hietanen
  • 181
  • 1
  • 1
  • 12
0
votes
1 answer

Repository EF DBContext

my question is a two part issue. I am using the repository and unit of work pattern with entity framework. I have the following StockTransferRepository and StockTransfer is my aggregateRoot. Public Class StockTransferRepository Inherits…
0
votes
1 answer

How to model a pricing structure based on a > (greater than) or < (less than) operand

I have a contract table like so (extraneous data removed): CREATE TABLE `contracts` ( `id` INT(12), `serviceid` INT(10), `mode` CHAR(1), `months` TINYINT(3), `dateStart` INT(12), `dateEnd` INT(12), PRIMARY KEY (`id`) ) Where the data…
denormalizer
  • 2,186
  • 3
  • 24
  • 36
0
votes
2 answers

How to determine where to place the foreign key in this scenario?

If I have two tables - Logins and Users, as follows: Logins LoginIdNo UserIdNo HashedPassword Users UserIdNo LoginIdNo Username Each login "has a user" and each user "has a login" but which "belongs to" which? Is it simply a judgment call…
0
votes
3 answers

EF4 Getting Associations In Separate Queries When Using POCOs

I want to build up an object graph using Entity Framework 4.2. Right now, I have POCO entities, using ICollection for navigation properties. I want to avoid using EntityCollection or anything EF-specific. I want to avoid massive joins caused by…
0
votes
2 answers

how do I design return travel itinerary vs one way itinerary

I'm not quite sure how to approach this problem: Price for one-way trips is different than price for round trip itineraries. In the backend, I have a table for storing the itinerary (which yields an id). I have another pricing table, which defines…
brainydexter
  • 19,826
  • 28
  • 77
  • 115
0
votes
1 answer

ER : entity relationship diagram

First I will describe my application and what you can do with it, then I will show you the technical relations between my entities at the end comes the question of course. My applications workflow: 1.) A user can create a "ReleaseVersion" object and…
Pascal
  • 12,265
  • 25
  • 103
  • 195
0
votes
1 answer

how to design pricing module at database level

I want to model the following scenario in the database: I have a Package, comprising of independent Activities and Hotel: Package P: Activities A1, A2, A3 Hotel H Activities and Hotel are independent entities which have their own price defined at…
brainydexter
  • 19,826
  • 28
  • 77
  • 115
0
votes
1 answer

How to define a 0..1 to many relationship in code-first

I'm reading ado.net team blog's articles these days, when I find how to create one to one relationship, one to many relationship and many to many relationship. But, is there a way to create 0..1 to many relationship? class TestA { public int id…
James
  • 2,570
  • 7
  • 34
  • 57
0
votes
1 answer

Mixing owning and referencing relationships in databases

I've used XML and hierarchical databases for a long time, where ownership is easy to determine. Now I'm trying out a relational database model in which I have a runtime context I'm loading entities to with unique ids and relational properties such…
Andreas Zita
  • 7,232
  • 6
  • 54
  • 115
0
votes
2 answers

Core Data Model in Personal Finance app

I'm developing a personal finance app using Core Data, but because I'm used to work in DBMS environment, I'm kind of confused here. The problem is, in the Data Model, I've decided to use four entities; Expense, Income, Goal and Recurring. But it…
0
votes
1 answer

Get id's of related entities during query in Doctrine2?

I have the following query: $qb = $this->em->createQueryBuilder() ->select(array('p','c' ,'sc')) ->from('Project\Entity\Product', 'p') ->innerJoin("p.category", "c") ->innerJoin("p.subcategory",…
pixel
  • 24,905
  • 36
  • 149
  • 251
0
votes
1 answer

Find objects in Core Data entities like a JOIN or WHERE statement

I have two Entities and I want to do a JOIN in Core Data. I know Core Data is not a MYSQL Database but I don't know how I can explain it otherwise. Here are my Entities: Entitys.png…
brush51
  • 5,691
  • 6
  • 39
  • 73
0
votes
1 answer

Spring Roo Cardinality Mapped By attribute

I am trying to map an Address entity and a Person entity using a OneToMany mapping: "Each person has only one address but an Address can have many people". @RooJavaBean @RooToString @RooEntity(identifierColumn = "addressID") public class Address { …
Warz
  • 7,386
  • 14
  • 68
  • 120
0
votes
2 answers

Many to many relationship with SQL Management Studio

I have the following datatypes - House, Owner, with the primary keys houseID and ownerID respectively. An Owner can have many Houses. And a House can Have many Owners. So I created an intermediate table HouseOwner that contains two columns, houseID…
Jim_CS
  • 4,082
  • 13
  • 44
  • 80