Boat station rents boats, kayaks, water skiing and more. They can be used in the three reservoirs of the river lake or pond. It is necessary to indicate the danger of navigation for each type of boat.

That is, I have three tables: ПЛАВСРВА(id, тип, название) , ВОДОЕМЫ(id, тип) , ОПАСНОСТЬ(id, тип) .

In short, it should sound or look, I do not even know how to describe IF the type of the yacht and the reservoir of the pond are that danger is HIGH.

  • I do not understand how to make a one-to-many relationship, and what additional tables can be created - Zakat

1 answer 1

 CREATE TABLE CurAttraction ( CurAttraction_ID int NOT NULL , Watercraft_ID int , Pond_ID int , Risk_ID int , PRIMARY KEY (CurAttraction_ID) , FOREIGN KEY (Watercraft_ID) REFERENCES Watercraft(Watercraft_ID) , FOREIGN KEY (Pond_ID) REFERENCES Pond(Pond_ID) , FOREIGN KEY (Risk_ID) REFERENCES Risk(Risk_ID) ) 
  • Thanks for the code, of course)) but I am still at the level of ER-diagrams, so it’s not quite clear to me - Zakat
  • @Zakat, you just need to create ONE table that will link your directories. - Mirdin