How to link a table to a field a in MySQL server

Posted by Nek on Stack Overflow See other posts from Stack Overflow or by Nek
Published on 2010-03-23T05:30:31Z Indexed on 2010/03/23 5:33 UTC
Read the original article Hit count: 261

Filed under:
|

I have this data from a xml file:

<?xml version="1.0" encoding="utf-8" ?>
<words>
    <id>...</id>
    <word>...</word>
    <meaning>...</meaning>
    <translation>
        <ES>...</ES>
        <PT>...</PT>
    </translation>
</words>

This forms the table named "words", which has four fields ("id","word","meaning" and "translation"). On the other hand, the "translation" field can hold several languages like ES,PT,EN,JA,KO,etc... So I create a table ("words.translation", one field is "id" and the others ones are languages ids like "ES","PT",...).

I'm sorry for this newby question, but I'd like to know a couple of things about this one-to-many relationship.

  1. How to join (or link?) this two tables in MySQL?
  2. What information does the "translation" field in the "words" table has to store?
  3. How is the sql query to get all the word information (JOIN syntax used?)

Thanks for your patience.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about one-to-many