1alter table group_a
2add constraint fk_b_in_a
3foreign key(`b_id`)
4 references group_b(`b_id`)
5 on delete set null
6 on update set null;
1CREATE TABLE IF NOT EXISTS `scores` (
2 `ID` int(11) NOT NULL AUTO_INCREMENT,
3 UserId int(11) NOT NULL,
4 `NICKNAME` varchar(50) NOT NULL,
5 `HIGHSCORE` int(11) NOT NULL,
6 PRIMARY KEY (`ID`),
7 FOREIGN KEY (UserId) REFERENCES USER(Id)
8);
1alter table caixa add foreign key (idcaixafluxo) references caixafluxo (idcaixafluxo);