-3

Hello I need help translating this E.R diagram to table

Do I create a table for each entity and relationship ?

Partial/total participation

  • Welcome to the community, but your relationships are so vague, it's not practical. Can you give better context of what you are trying to do / create / purpose. Even if it is describing what you are trying to build, only then might you get better response vs immediate close on the question. – DRapp Dec 08 '18 at 18:48

2 Answers2

0
  Create Table E ( Id VARCHAR(10) PRIMARY KEY)
  CREATE TABLE R(ID VARCHAR(10) FOREIGN KEY 
 REFERENCES E(Id)) , Value VARCHAR(10))

    INSERT INTO E VALUES("R1");
    INSERT INTO E VALUES("R2");
   INSERT INTO R VALUES("R1",A1);
    INSERT INTO R VALUES("R2",A2);

Meaning each entity E is an ID and Id has a Value (1-1) meaning for each id one value but E has many ids (0-n). But you should agree that the relationships are impractical and are of no use.

Himanshu
  • 3,830
  • 2
  • 10
  • 29
0

As far as I understand, this means that entities E1 and E2 have one-to-many relation with the entity E. In a way, you could define a table for each entity E, E1 and E2 and define the foreign keys of E1 and E2 in the E table.

hadi.mansouri
  • 828
  • 11
  • 25
  • yeah thats what the unclear (0-n) ?? called as per the OP's query having all the entities E1,E2,..En as we refer as `Is a Relationship` then thereafter `has a ` R1 or becomes R1 with one to one has a Value as A1 likewise. simply limbo relationship i could say via unclear ER – Himanshu Dec 08 '18 at 19:14