Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Opa pessoal, sou novo por aqui e assim como muitos estou iniciando meus estudos sobre mysql. Tipo estava montando um banco de dados para "calcar" meus poucos conhecimentos em mysql e vem acontecendo um erro vou postar o código aqui para vocês darem uma analisada. :
mysql> create table cliente(
-> cod_cliente int not null,
-> nome_cliente char(100) not null,
-> endereco char(100) not null,
-> cidade char(40),
-> uf char(2),
-> cgc char(18),
-> ie char(9),
-> primary key(cod_cliente),
-> foreign key(uf) references unid_fed);
ERROR 1005 (HY000) _linenums:0'>mysql> create table produto( -> cod_produto char(5) primary key, -> descricao char(40) not null, -> unidade char(2) not null default "pc", -> preco_unit decimal(7,2) not null);Query OK, 0 rows affected (0.05 sec)mysql> show tables;+-----------------+| Tables_in_lojas |+-----------------+| produto || unid_fed |+-----------------+2 rows in set (0.00 sec)<strong class='bbc'>mysql> create table cliente( -> cod_cliente int not null, -> nome_cliente char(100) not null, -> endereco char(100) not null, -> cidade char(40), -> uf char(2), -> cgc char(18), -> ie char(9), -> primary key(cod_cliente), -> foreign key(uf) references unid_fed);ERROR 1005 (HY000): Can't create table '.\lojas\cliente.frm' (errno: 150)</strong>mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || lojas || mysql || test |+--------------------+4 rows in set (0.00 sec)mysql> use lojas;Database changedmysql> show tables -> ;+-----------------+| Tables_in_lojas |+-----------------+| produto || unid_fed |+-----------------+2 rows in set (0.00 sec)mysql> create table vendedor
Abrações !
Carregando comentários...