onde esta o erro ?
12:38:31 create table ficha( cod_ficha int auto_increment not null primary key, data_ficha date, cod_cliente int auto_increment not null, cod_endereco int auto_increment not null, cod_produto int auto_increment not null, foreign key (cod_cliente) references cliente(cod_cliente), foreign key (cod_endereco) references endereco(cod_endereco), foreign key (cod_produto) references produto(cod_produto), ) Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 10 0.000 sec
create database cadastro;
use cadastro
create table ficha(
cod_ficha int auto_increment not null primary key,
data_ficha date,
cod_cliente int auto_increment not null,
cod_endereco int auto_increment not null,
cod_produto int auto_increment not null,
foreign key (cod_cliente) references cliente(cod_cliente),
foreign key (cod_endereco) references endereco(cod_endereco),
foreign key (cod_produto) references produto(cod_produto)
);
create table cliente(
cpf bigint(11) unique not null primary key,
cod_cliente int not null primary key,
rg_cliente bigint (9) unique not null,
nome_cliente varchar (100) not null,
foreign key (cod_endereco) references ficha(cod_endereco)
);
create table endereco(
cod_endereco int not null primary key,
rua varchar (100) not null,
numero_rua bigint (100),
complemento varchar (100),
foreign key (cod_cidade) references cidade(cod_cidade)
);
create table cidade(
cod_cidade int auto_increment not null primary key,
nome_cidade varchar(70),
foreign key (estado_uf) references estado(estado_uf)
);
create table estado(
estdado_uf int auto_increment not null primary key,
nome_estado_uf varchar(2)
);
create table produto(
cod_produto int not null primary key,
descricao varchar(50) not null,
quantidade bigint(1000) not null,
preco_uni decimal(7,2) not null,
preco_total decimal(7,2) not null,
valor_total decimal(7,2) not null
);
