Answer the question
In order to leave comments, you need to log in
How to correctly design a relationship between database tables (see description)?
There is a table with languages between which there can be a translation.
Approximately with the following structure:
id name
You need to create a table of words with translations. The same word can be translated differently into different languages.
Therefore, it is necessary to link the word itself, the language "from which" and the language "into which" we are translating.
For me, the obvious solution is a composite key of three fields. But is it normal that 2 of these fields are secondary keys of the same table.
Is there any other solution for such situations?
Answer the question
In order to leave comments, you need to log in
Isn't that easier?
CREATE TABLE `words` (
`word_id` INT NOT NULL,
`language_id` INT NOT NULL,
`word` VARCHAR(45) NULL);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question