ERD Diagram relationship - erd

I have a diagram of entity-relationship. The question is how A relates to D. I understand how entities relate to each other but haven't found a good explanation of how something like this relates. Any help would be appreciated. Thanks.

A does not relates to D in any way. C has a relation with both A and D.
Eg let say c entity is person.
D entity is number of phone numbers
A entity is number of houses.
As you can see a person can have multiple houses and phones but there is no relation between a house and phone.

I have found a nice picture by briefly explaining the relationships:
So you once have a 1-to-0..* relationship and a 0..*-to-1 relationship.
EDIT:
I guess this is a many-to-many relationship. The diagram shows the representation in the database. And only for this relation a third entity is needed to store the keys.

Related

Difference between One-Mnay relationship & Many-Many relationship

I am just confused about One-One relationship and Many-Many relationship. Well if I have a users table and a course table, Do I have to add a third table to make it Many-Many relationship or I can just connect them with foreign keys and primary keys? I hope my question is clear to you.
One-to-Many example :-
Many to One example :-
Teacher teaches students is one to many relationship
And students learning from the teacher is many to one relationship
May be your dought is clear now!!
You are asking about many to many relationship. In this imaginary relation you have to follow following steps
1-create two tables(users,courses)
2-make third table which is called pivot table . that will contains the foreighn keys of both tables that shows the relation b/w two tables.
3-You also have to make relationships of one-to-many in both tables(users,courses).
I hope this helps if not visit this link you will understand.
https://onlinewebtutorblog.com/laravel-8-many-to-many-eloquent-relationship-tutorial/

How to data model endorsement for a service provided by a person, Graph Data modeling

Hi I am new to graph database modeling and have some doubts about expressing an endorsment for a service provided by a Person. The use case is the following. PersonA gives Endorsement to a Service provided by PersonB.
The key point is that If I am recipient of the endorsment, I would like to know who has endorsed me. I have come up with several scenarios on how I could potentialy do that, but because of my lack of experience I have doubts on what would be the best aproach.
Scenario 1.
Endorsment is expressed direcly as a relationship and the service falls as a property under the endorsment So it will look like:
PersonA-------ENDORSE{service}--->PersonB
Scenario 2
I model an entity named Service. The problem is that when I do the relationship "ENDORSE" to service I would loose information on who am I endorsing. So I would have to keep a property in the relationship on who am I endorsing. Then the PersonB would AQUIRE endorsment for the SERVICE but he would not know who has actualy givern the endorsment. So..... it will look like this:
PERSONA----ENDORSE{personB}--->Service------ENDORSMENT{personA}--->PERSONB
Does this make sense ?
Scenario 3:
I normalize the second relationship "ENDORSMENT" and exclude the personA as a property , but than I need to query all Person to find out who have they endorsed.
How would you model this kind of relationship ?
Two important principles for validating a data model for a graph database:
if an entity or fact can be used more than once, then it should be stored
as the node
if the relationship of two nodes requires to store node
identifiers, then this relationship must be transformed into a node
So #Raj pointed the right way, in which case the model might look like this:
I recommend you read this:
https://neo4j.com/graph-databases-book/
http://patterns.dataincubator.org/book/
The second approach looks good, you don't have to add these properties on relationships.
It's possible to get person A who endorsed person B for service S.
The only issue with this is there will be multiple nodes for any service S. If that's not acceptable.
You can replace the Service node in the second approach with Endorse node E and connect this E to service node S.
So there will be four types of nodes.
EDIT:
Adding an image for clarification.
Rename REL1 and REL2 as you wish.
#Stdob suggested some good names for these relationships.

Class associations and multiplicity - UML 2.0 - object oriented (Basic)

I am learning UML and I've focused on a Netflix-like project on which to practice on.
I've put together a class association diagram, but have been told that the multiplicities are incorrect. The multiplicities in red represent what I think they should be changed to.
Could someone please offer some clarity of where I have gone wrong?
Please, ask any questions that would help gain a fuller understanding of the diagram in reference to the project.
Thanks in advance.
Movie Catalog - User: The 0..* multiplicity is correct. There can be an arbitrary number of users and not only a single one. That would only work if that Netflix was made for a very single person. And that would be pointless, I guess.
Movie - Membership - Member: This represents an association class for the user to track payments (and access, etc.). So it must be the 1, not 0..*. The stream is sent for that single Membership where it is accounted. An association class has a n-1-1-m relation.
In your model it looks like this:
And from my POV it is:
since the Membership is just used to control access to the movies. It is arguable whether there is only a 1-1 relation and not a (preferable) m-1 relation between Member and Membership.

ERD Issue: Gallery & Company Relationship is wrong

Quick Summary: I'm building an ERD diagram and got lost in connecting two tables.
Introduction:
I'm building an ERD diagram for my project. Idea is pretty straight forward: I can type information about the company and it will be saved in the database. Later, I can see the list of submitted companies, as a list. As of now, I've information on the "paper", which I've implemented into my ERD diagram, so that later I can tell database, what exactly must be saved and where.
I have a primary table "Company_Info" which stores all the information about the company in the database. Using common sense (or not :)) I've created "Foreign Tables" that would store information about the company: "Gallery Images", "Opening_hours", etc. This way I believe, the database would more or less clear and readable by others.
ERD Diagram with the Description of all relationships
Problem Statement
The idea was to create a simple gallery for the company, so that they can upload their Product-pictures. If it's possible I would like to talk about the relationship between the Gallery and the Company tables. The way I see it, I think it should be like this:
One company can have 0,1,2 or many images. (Gallery_Images Table)
Images must be assigned to only 1 company. (Company_Info Table)
The relationship is one mandatory to many optional. (Many images & one company)
Question: I think the relationship between the Gallery_Table and Company_Info table will not work. Reason: Wrong relationship. I'm confused about the connection between those two tables.
I have made a connection via company PK & FK. This way, I think, the database would know what images belong to that specific company.
Confusion is with gallery_id in Gallery_Images table. Shouldn't it be connected with the company_info table too?
Image(BLOB) is a repeating group in Gallery_Images. This is not a problem if your purpose is to draw a diagram of an ER model.
If your purpose is to draw a diagram of a relational model, then the repeating group is a departure from First Normal Form. Relational schemas that depart from 1NF are generally subject to terrible problems, both with regard to performance and with regard to data management itself.
I don't see the Gallery table in your diagram. Did I miss something?

ER diagram - design issues

There are 3 entities:
vehicle_model
vehicle
extra_options (such as open top, leather seats, etc..)
Vehicle model can have a subset of the extra options.
Vehicle can have a subset of it's model extras.
I've been trying hours to figure out how to represent this as er diagram, but without success. I Thought about ternary relationship ,and although I don't understand it completely I think this isn't the way.
I thought about creating another 2 entities, model_ext & vehicle_ext ,so that vehicle_ext would be connected to model_ext but this isn't a good design.
This is my first er diagram design. I'm really lost (read er-diagram chapter in "Silberschatz, Database System Concepts" three times already) so any idea would be appreciated.
did you try adding a new table say 'vehicle_vehicle_model_extra_options_map'? (you can name this table to any thing short, but for better explanation i use __map as a standard way for defining the map tables.)
note those two null able foreign key columns in this table.
Basically, vehicle has one to many relation to extra_options, and vehicle_model has one to many relation to extra_options table, therefore the new table was added.
updated:

Resources