CREATE TABLE PESSOA
(
ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
CPF VARCHAR(15) NOT NULL,
RG VARCHAR(10) NOT NULL,
NOME VARCHAR(128) NOT NULL,
DATA_NASCIMENTO DATE,
PRIMARY KEY (ID)
)
CREATE TABLE CADASTRO
(
ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
RA INTEGER UNSIGNED NOT NULL,
NOME VARCHAR(128),
NOTA_TEORICA NUMERIC(10,2),
NOTA_LAB NUMERIC(10,2),
MEDIA NUMERIC(10,5),
FK_CPF INTEGER UNSIGNED NOT NULL,
PRIMARY KEY(ID)
)
I need the CPF field of the PERSON table to be foreign key in FK_CPF of the SIGNATURE table