Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/06/2010, 20:39
Avatar de guichogdl
guichogdl
 
Fecha de Ingreso: abril-2010
Ubicación: gdl
Mensajes: 131
Antigüedad: 14 años
Puntos: 1
Pregunta error al crear tablas en mysql 5 modo consola

hola a todos esoty trabajando en Mysql 5 en modo consola, tengo un problema al crear dos tablas en mi script me marca este error:

ERROR 1005 (HY000): Can't create table '.\hotel\facturacliente.frm' (errno: 150)

me lo marca en las dos ultimas tablas ya revise la sintaxis y que este correcta igual las referencias de las llaves foraneas pero nada, todo lo veo bien, estan son las dos tablas del error

/* TABLA FACTURA CLIENTE */
/* TABLA FACTURA SERVICIO */

anexo el script esperando me puedan mencionar porque el del error y como solucionarlo:



/* BASE DE DATOS HOTELES DE MEXICO */

create database hotel;

use hotel

/* TABLA HOTEL */

create table hotel
(id_hotel integer not null,
nombre varchar(35) not null,
direccion varchar(35) not null,
telefono varchar (30) not null,
constraint PK_Hotel primary key(id_hotel));



/* TABLA CLIENTE */

create table cliente
(id_c integer not null,
nombre varchar(35) not null,
apellidos varchar(35) not null,
ciudad varchar(35) not null,
pais varchar(35) not null,
email varchar(35) null,
rfc varchar(35) null,
constraint PK_cliente primary key(id_c));

/* TABLA HABITACION */

create table habitacion
(id_c integer not null,
num_hab integer not null,
tipo_hab varchar (40) not null,
piso integer not null,
estatus varchar(35) not null,
constraint PK_habitacion primary key(num_hab,id_c),
constraint FK_habitacion_idc foreign key(id_c) references cliente(id_c));


/* TABLA RESERVACION */

create table reservacion
(id_reservacion integer not null,
id_c integer not null,
fecha date not null,
cant_hab integer not null,
tipo_hab varchar(35) not null,
dias_reservar integer not null,
observ varchar(35) not null,
constraint PK_reservacion primary key(id_reservacion),
constraint FK_reservacion_tipohab foreign key(tipo_hab) references habitacion(tipo_hab),
constraint FK_reservacion_idc foreign key(id_c) references cliente(id_c));


/* TABLA PROVEEDOR */

create table proveedor
(id_prov integer not null,
nombre varchar(35) not null,
rfc varchar(35) not null,
direccion varchar(35) not null,
telefono varchar(35) not null,
tipo_serv varchar(35) not null,
constraint PK_idprov primary key(id_prov));


/* TABLA REGISTRO DE SERVICIOS */

create table registro_servicios
(id_serv integer not null,
tipo_serv varchar(35) not null,
costo numeric(5,2) not null,
fecha date not null,
cant_pers integer not null,
caract integer not null,
observaciones varchar(50) not null,
constraint PK_registro_servicios primary key(id_serv));


/* TABLA FACTURA CLIENTE */

create table facturacliente
(id_folio integer not null,
id_c integer not null,
rfc varchar(35) null,
tipo_hab varchar (40) not null,
num_hab integer not null,
fecha_salida date not null,
total numeric (8,2) not null,
constraint PK_fact_folio primary key (id_folio),
constraint FK_fact_idc foreign key (id_c) references cliente(id_c),
constraint FK_fact_RFC foreign key (rfc) references cliente(rfc),
constraint FK_fact_tiphab foreign key (tipo_hab) references habitacion(tipo_hab),
constraint FK_fact_nohab foreign key (num_hab) references habitacion(num_hab));


/* TABLA FACTURA SERVICIO */

create table factura_servicio
(id_serv integer not null,
id_c integer not null,
tipo_serv varchar(35) not null,
fecha date not null,
costo numeric(5,2) not null,
constraint Pk_factura_servicio primary key(id_serv),
constraint FK_factura_idserv foreign key (id_serv) references registro_servicios(id_serv),
constraint FK_factura_IDC foreign key (id_c) references cliente(id_c),
constraint FK_factura_tiposerv foreign key (tipo_serv) references registro_servicios(tipo_serv));




gracias de antemano e igual estaria bueno algun comentario sobre como hice mi script para una aplicacion senciila de un hotel (practica)