Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

tabela sql com chave primária de outra tabela


Algo assim
   CREATE TABLE mynewtable
    (
      location varchar(255),
      color varchar(255),
      PRIMARY KEY (id),
      FOREIGN KEY (table_1_id) REFERENCES table_1(id),
      FOREIGN KEY (table_1_name) REFERENCES table_1(name),
    )