How to make an Insert in this table

Asked

Viewed 74 times

0

I have a registration of vehicles, which has a combo box with the years for the user to choose, these years come from the table "year". When I complete a registration of a new car, I have to give an insert in the table "car", my problem is there, how will I save the year that the user chose, if the table "car" does not have this field? Tabela

  • In a ratio 1 for many, as you defined between Car/Vehicle and Vehicle/Year, you will need to store the id of one table as a foreign key in the other. In this case, the id from table 1 as foreign key in many table.

  • @Andersoncarloswoss I’m still learning, could give the example with the tables I have?

  • Have how to detail what would be the vehicle table? It was not very clear to me the difference from it to car.

  • @Andersoncarloswoss Of course, it came about because of the Cardinality (0.N), from what I saw in class this table Vehicle, it only receives foreign key. If there’s any doubt, I’ll try another example.

1 answer

0

  • Okay, I’ll try. But if I try to do a search just for the year, I can?

  • yes you can...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.