In fact what you want to do is a link N to N between 2 tables, which is already known that it is not possible, so you do the trick of using a third table between the 2 tables that will contain the Id and the Id of another, so you would have something like this:
TABELA TITULO:
IdTitulo inteiro CHAVE PRIMARIA,
Nome string,
Link string,
TABELA CATEGORIA:
IdCategoria inteiro CHAVE PRIMARIA,
Nome string,
Link string,
TABELA TITULO_CATEGORIA:
IdTituloCategoria inteiro CHAVE PRIMARIA,
IdTitulo inteiro CHAVE ESTRANGEIRA,
IdCategoria inteiro CHAVE ESTRANGEI
RA
In the Table we have the Id of the tables Title and Category, the links will be like this:
Titulo 1---------------N TituloCategoria N-------------1 Categoria
An example of how a link looks like this (the tables are different but the case is identical to yours):
I must remind you that every foreign key is a primary key as well, and every primary key can be a foreign key from another table. You cannot say that the Title name is a foreign key because it is not a primary key. Primary keys should always be integer, DBMS tool can even allow it to be a string
but this is completely wrong. Primary keys should always be values that never will repeat themselves or pass close to repeat themselves.
I think it is not a good idea that the primary key of the Titles table is the name. First because it’s a string later because there might be more than one movie with the same title.
– ramaral
what is the need for the middle table ?
– Up_One
we can see what you have so far ?
– Up_One
Up_one, I put down what I did. Thank you for trying to help.
– debeka