Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. mysql 1 to many ralationship

mysql 1 to many ralationship

Scheduled Pinned Locked Moved Database
databasetutorialmysqlquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Raymart Calinao AsthreA
    wrote on last edited by
    #1

    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..

    P 1 Reply Last reply
    0
    • R Raymart Calinao AsthreA

      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..

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      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.

      R 1 Reply Last reply
      0
      • P PIEBALDconsult

        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.

        R Offline
        R Offline
        Raymart Calinao AsthreA
        wrote on last edited by
        #3

        ok thanks for the reply and tips so can you give me an example if you don't mind?

        P 1 Reply Last reply
        0
        • R Raymart Calinao AsthreA

          ok thanks for the reply and tips so can you give me an example if you don't mind?

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          No. Just try it. And read up on normalization.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups