aula banco01111

tb_estado 1--------* | tb_cidade|
### TB_ESTADO [1]
create table tb_estado(
id_estado int(11) not null auto_increment primary key,
estado varchar(50),
sigla char(2),
regiao varchar(15)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

tb_ cidade

create table tb_cidade(
id_cidade int(11) not null auto_increment primary key,
cidade varchar(150),
capital enum('m','c') default 'm',
cid_id_estado int(11) not null,
foreign key (cid_id_estado) references tb_estado (id_estado)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Comentários

Postagens mais visitadas deste blog

Banco de dados resumo..

Aula03 Html

Comandos Vim