Tablas de la base de datos en Mysql:
mysql> CREATE DATABASE bibliodig;
Crear las tablas
CREATE TABLE autor(id_autor INT NOT NULL PRIMARY KEY AUTO_INCREMENT, nombre VARCHAR(30),apellido1 VARCHAR(30), apellido2 VARCHAR(30), nacionalidad VARCHAR(30));
insert into autor values(null, "Reynaldo", "Martinez", "Parra","Espa¤ol");
insert into autor values(null, "Ana", "Maria", "Ramb","Argentina");
Query OK, 1 row affected (0.08 sec)
mysql> insert into autor values(null, "Jesus", "Rojas", "Rivadeneira","Espa¤ol");
Query OK, 1 row affected (0.04 sec)
mysql> insert into autor values(null, "Hector", "Aguilar", "Camin","Mexicano");
Query OK, 1 row affected (0.12 sec)
mysql> insert into autor values(null, "Elena", "Garro", "Navarro","Mexicana");
Query OK, 1 row affected (0.08 sec)
mysql> insert into autor values(null, "Jesus", "Rojas", "Rivadeneira","Espa¤ol");
Query OK, 1 row affected (0.04 sec)
mysql> insert into autor values(null, "Hector", "Aguilar", "Camin","Mexicano");
Query OK, 1 row affected (0.12 sec)
mysql> insert into autor values(null, "Elena", "Garro", "Navarro","Mexicana");
CREATE TABLE editorial(id_editorial INT NOT NULL PRIMARY KEY AUTO_INCREMENT, nombre_ed VARCHAR(30), callenum_ed VARCHAR(80),id_codpostal INT NOT NULL, id_teled INT NOT NULL, ciudad VARCHAR(30), INDEX(id_codpostal), INDEX(id_teled));
CREATE TABLE codigopostal(id_codpostal INT NOT NULL PRIMARY KEY, cp VARCHAR(30));
CREATE TABLE teled(id_teled INT NOT NULL PRIMARY KEY AUTO_INCREMENT, telefono VARCHAR(30);
Ya ingresados los datos:
CREATE TABLE libro(ISBN INT NOT NULL, id_autor INT NOT NULL, id_editorial INT NOT NULL,titulo VARCHAR(30), edicion VARCHAR(30), idioma VARCHAR(30));
INSERT INTO libro VALUES(01342,1,3,"Aura","1ra edicion","Espa¤ol");
INSERT INTO libro VALUES(05687,4,2,"Libertad bajo palabra","2da edicion","Espa¤ol");
INSERT INTO libro VALUES(05687,4,2,"Confabulario","3ra edicion","Espa¤ol");
INSERT INTO libro VALUES(05687,4,2,"Libertad bajo palabra","2da edicion","Espa¤ol");
INSERT INTO libro VALUES(05687,4,2,"Confabulario","3ra edicion","Espa¤ol");
INSERT INTO libro VALUES(05127,3,3,"El milagro mas grande del mundo","3ra edicion","Espa¤ol");
No hay comentarios:
Publicar un comentario