mysql 1 to many ralationship
-
I'm new to mysql .. I need a One to many ralation tutorial.. like for example I made a table called MovieList with 1 column name TitleMovie and now I want to create another table called acc1_MyWatchlist and inside of it was also a TitleMovie..my question is I want insert a value in acc1_mywatchlist but only the available values in Movielist's TitleMovie and If I tried to create another table acc2_mywaychlist it should be the same as the first table and if I tried to edit some values in the MovieList table it should be affect all the table that has the same column TitleMovie.... in Access database I just use the lookup wizard but ofcourse mysql is differnt so can you give me some examples of this query..
-
I'm new to mysql .. I need a One to many ralation tutorial.. like for example I made a table called MovieList with 1 column name TitleMovie and now I want to create another table called acc1_MyWatchlist and inside of it was also a TitleMovie..my question is I want insert a value in acc1_mywatchlist but only the available values in Movielist's TitleMovie and If I tried to create another table acc2_mywaychlist it should be the same as the first table and if I tried to edit some values in the MovieList table it should be affect all the table that has the same column TitleMovie.... in Access database I just use the lookup wizard but ofcourse mysql is differnt so can you give me some examples of this query..
I don't think you understand normalisation and references. It sounds like your first table should have and ID of some type as well as the title. Other tables would then refer to that ID, not to the title. If you need to alter the title, the IDs stay the same and no other tables need to be updated.
-
I don't think you understand normalisation and references. It sounds like your first table should have and ID of some type as well as the title. Other tables would then refer to that ID, not to the title. If you need to alter the title, the IDs stay the same and no other tables need to be updated.
ok thanks for the reply and tips so can you give me an example if you don't mind?
-
ok thanks for the reply and tips so can you give me an example if you don't mind?
No. Just try it. And read up on normalization.