Ver Mensaje Individual
  #12 (permalink)  
Antiguo 27/11/2009, 12:13
alx_salazar
 
Fecha de Ingreso: septiembre-2008
Mensajes: 192
Antigüedad: 15 años, 7 meses
Puntos: 1
Respuesta: aUXILIO!!!! Ayuda muy importante n se que le pasa a java con mysql

hola
porfavor puedes darme un punto de vista sobre este nuevo diseño, estuve siguiendo tus observaqciones

*================================================= =============*/
/* Table: AUTOR */
/*================================================= =============*/
create table AUTOR
(
COD_AUTOR integer not null,
NOM_AUTOR varchar(40),
APE_AUTOR varchar(40),
primary key (COD_AUTOR)
);

/*================================================= =============*/
/* Table: AUTOR_LIBRO */
/*================================================= =============*/
create table AUTOR_LIBRO
(
COD_AUTOR integer not null,
COD_LIBRO integer not null,
primary key (COD_AUTOR, COD_LIBRO)
);

/*================================================= =============*/
/* Index: RELATIONSHIP_1_FK */
/*================================================= =============*/
create index RELATIONSHIP_1_FK on AUTOR_LIBRO (
COD_AUTOR ASC
);

/*================================================= =============*/
/* Index: RELATIONSHIP_2_FK */
/*================================================= =============*/
create index RELATIONSHIP_2_FK on AUTOR_LIBRO (
COD_LIBRO ASC
);

/*================================================= =============*/
/* Table: EDITORIAL */
/*================================================= =============*/
create table EDITORIAL
(
COD_EDITORIAL integer not null,
NOM_EDITORIAL varchar(40),
DIR_EDITORIAL varchar(40),
EMAIL_EDITORIAL varchar(40),
TELF_EDITORIAL varchar(9),
primary key (COD_EDITORIAL)
);

/*================================================= =============*/
/* Table: LIBRO */
/*================================================= =============*/
create table LIBRO
(
COD_LIBRO integer not null,
COD_EDITORIAL integer,
NOM_LIBRO varchar(40),
TEMA_LIBRO varchar(100),
DESC_LIBRO varchar(800),
ANO_LIBRO varchar(4),
primary key (COD_LIBRO)
);

/*================================================= =============*/
/* Index: RELATIONSHIP_5_FK */
/*================================================= =============*/
create index RELATIONSHIP_5_FK on LIBRO (
COD_EDITORIAL ASC
);

/*================================================= =============*/
/* Table: PRESTA_LIBRO */
/*================================================= =============*/
create table PRESTA_LIBRO
(
COD_LIBRO integer,
CI_USUARIO integer,
FECHA_PRESTA timestamp,
FECHA_DEVO timestamp
);

/*================================================= =============*/
/* Index: RELATIONSHIP_3_FK */
/*================================================= =============*/
create index RELATIONSHIP_3_FK on PRESTA_LIBRO (
CI_USUARIO ASC
);

/*================================================= =============*/
/* Index: RELATIONSHIP_4_FK */
/*================================================= =============*/
create index RELATIONSHIP_4_FK on PRESTA_LIBRO (
COD_LIBRO ASC
);

/*================================================= =============*/
/* Table: USUARIO */
/*================================================= =============*/
create table USUARIO
(
CI_USUARIO integer not null,
NOM_USUARIO varchar(40),
APE_USUARIO varchar(40),
DIR_USUARIO varchar(40),
EMAIL_USUARIO varchar(40),
TELF_USUARIO varchar(40),
primary key (CI_USUARIO)
);

alter table AUTOR_LIBRO
add foreign key FK_AUTOR_LI_RELATIONS_AUTOR (COD_AUTOR)
references AUTOR (COD_AUTOR)
on update restrict
on delete restrict;

alter table AUTOR_LIBRO
add foreign key FK_AUTOR_LI_RELATIONS_LIBRO (COD_LIBRO)
references LIBRO (COD_LIBRO)
on update restrict
on delete restrict;

alter table LIBRO
add foreign key FK_LIBRO_RELATIONS_EDITORIA (COD_EDITORIAL)
references EDITORIAL (COD_EDITORIAL)
on update restrict
on delete restrict;

alter table PRESTA_LIBRO
add foreign key FK_PRESTA_L_RELATIONS_USUARIO (CI_USUARIO)
references USUARIO (CI_USUARIO)
on update restrict
on delete restrict;

alter table PRESTA_LIBRO
add foreign key FK_PRESTA_L_RELATIONS_LIBRO (COD_LIBRO)
references LIBRO (COD_LIBRO)
on update restrict
on delete restrict;