llevo dandole vueltas al asunto bastante tiempo y no consigo saber como estructurar esta base de datos, en esta ultima vez yo pensaba que todo estaba bien... pero no, me ha dado este error:
Cita:
La cosa es que quiero relacionar esas tablas... pero es la primera vez que relaciono tablas y no me ha salido... solo tengo tablas simples por ahora que como os imaginais no sirven para nada....#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 ') TYPE=InnoDB' at line 4
mi sql es este:
Código:
¿como debo relacionar estas tablas? create table artistas ( artid int unsigned not null auto_increment primary key, nombre char(50) not null, bio text not null, foto char(50) not null, web char(80) not null, fecha datetime not null default 'No hay datos' ) TYPE=InnoDB; create table audio_tracks ( trackid int unsigned not null auto_increment primary key, artid int unsigned not null, estiloid int unsigned not null, nombre char(100), url char(120), peso float(3,2) not null, duracion float(2,2) not null, fecha datetime not null, INDEX (artid), INDEX (estiloid), FOREIGN KEY (artid) REFERENCES artistas(artid), FOREIGN KEY (estiloid) REFERENCES estilos(estiloid) ) TYPE=InnoDB; create table sets ( setid int unsigned not null auto_increment primary key, artid int unsigned not null, estiloid int unsigned not null, nombre char(100), url char(120), peso float(3,2) not null, duracion float(2,2) not null, fecha datetime not null, INDEX (artid), INDEX (estiloid), FOREIGN KEY (artid) REFERENCES artistas(artid), FOREIGN KEY (estiloid) REFERENCES estilos(estiloid) ) TYPE=InnoDB; create table estilos ( estiloid int unsigned not null auto_increment primary key, estilo char(50) not null, ) TYPE=InnoDB;