2.- Base de datos de ejemplo para el curso de sql con mysql

Trabajaremos con la base de datos película que utilizaremos en todo el curso de sql con mysql, este curso estará enfocado para el diseño de páginas web dinámicas y sistemas web.

 

Utilizaremos la base de datos películas, puedes descargar aquí los script para que puedan tener la base de datos. Descarga este pdf

Copia el siguiente código y a tu archivo recien creado ponle la extensión .sql o pega el contenido del script en workbench. en el siguiente vídeo te explicaremos como hacerlo. 

CREATE DATABASE IF NOT EXISTS `peliculas` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `peliculas`; -- MySQL dump 10.13 Distrib 5.7.22, for Linux (x86_64) -- -- Host: 127.0.0.1 Database: peliculas -- ------------------------------------------------------ -- Server version 5.7.22-0ubuntu18.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `cliente` -- DROP TABLE IF EXISTS `cliente`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `cliente` ( `clicodigo` int(6) NOT NULL, `cliapellido` varchar(45) DEFAULT NULL, `clinombre` varchar(45) DEFAULT NULL, `clidociden` varchar(45) DEFAULT NULL, `clidirecc` varchar(50) DEFAULT NULL, `clitelfijo` int(8) DEFAULT NULL, `clitelmovil` int(8) DEFAULT NULL, `clititulo` varchar(45) DEFAULT NULL, `clicredito` int(4) DEFAULT NULL, `clirelacio` int(6) DEFAULT NULL, PRIMARY KEY (`clicodigo`), KEY `fk_cliente_cliente1_idx` (`clirelacio`), CONSTRAINT `fk_cliente_cliente1` FOREIGN KEY (`clirelacio`) REFERENCES `cliente` (`clicodigo`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `cliente` -- LOCK TABLES `cliente` WRITE; /*!40000 ALTER TABLE `cliente` DISABLE KEYS */; INSERT INTO `cliente` VALUES (100001,'Vargas Mendoza','Rafael Honorio','40283056','Alfonso Ugarte 200',428424,NULL,'Sr.',40,NULL),(100002,'Delgado Medina','Sandy Fabiola',NULL,'Av. 13 de junio 408',423327,9563245,'Srta.',34,NULL),(100003,'Cornejo Valdivia','Shirely Beatriz','88032405','Av. Arequipa 1014',265003,NULL,'Srta.',40,NULL),(100004,'Martín Valdivia','Carolina','29676047','Av. Arequipa 917',264834,NULL,'Sra.',15,NULL),(100005,'Arias Padilla','Diego Fabián',NULL,'Av. Mariscal Castilla 104',286472,NULL,'Sr.',20,NULL),(100006,'Mamani Hallasi','Luis Herickson',NULL,'Calle Berlín 216',452577,9652487,'Sr.',40,NULL),(100007,'Apaza Llacsa','Gleny Sabrina','41048762','Calle San Camilo 303 Int.',944236,NULL,'Srta.',15,NULL),(100008,'Delgado Luna','Olinda Sujey','40392911','Coop. Universitaria C-12-A',205375,NULL,'Sra.',20,NULL),(100009,'Tello Baldarrago','Juan Manuel',NULL,'Chachapoyas 513',436280,NULL,'Sr.',25,NULL),(100010,'Cuadros Díaz','Juan Carlos','40726286','Chullo 852',257274,9485263,'Sr.',50,NULL),(100011,'Valdivia Tejada','Roger Giancarlo',NULL,'Hipólito Unanue 102',200904,NULL,'Sr.',35,NULL),(100012,'Mérida Valdivia','Antonio Manuel','41247003','La Melgariana I-11 J',426460,NULL,'Sr.',25,NULL),(100013,'Mérida Carrasco','Lourdes',NULL,'La Melgariana I-11 J',426460,NULL,'Srta.',40,100012),(100014,'Mérida Carrasco','María Angélica',NULL,'La Melgariana I-11 J',426460,NULL,'Srta.',15,100012),(100015,'González Salazar','Juan Carlos','40213689','Las Dalias 111',256692,NULL,'Sr.',25,NULL),(100016,'Noboa Chirinos','Lucía','45684527','Los Cerezos 111',251865,NULL,'Srta.',25,NULL),(100017,'Noboa Chirinos','Andrea',NULL,'Los Cerezos 111',251865,NULL,'Srta.',35,100016),(100018,'Rodriguez Zamora','Yesenia Denisse del Carmen','29710822','Los Laureles Ñ-25',425764,NULL,'Srta.',NULL,NULL),(100019,'Chávez Macedo','Jeesica Maribel','29619711','Malecón Socabaya 115',205079,NULL,'Srta.',30,NULL),(100020,'Zegarra Ordoñez','Olga Elvira','26251485','Pizarro 210',460968,NULL,'Sra.',30,NULL),(100021,'Huertas Zegarra','Carlos Manuel',NULL,'Pizarro 210',460968,NULL,'Sr.',35,100020),(100022,'Huertas Zegarra','Lisandro',NULL,'Pizarro 210',460968,NULL,'Sr.',25,100020),(100023,'Huertas Zegarra','Adriana',NULL,'Pizarro 210',460968,NULL,'Srta.',25,100020),(100024,'Palacios Monje','Johanna Karina','41249282','Recidencial Nicolás de Pierola 2da. Etapa B4-16',202845,NULL,'Sra.',NULL,NULL),(100025,'Apaza Quispe','Luz Marina','41165443','San José de Tiabaya Comite 8 Lt.9 Mz.LL',607341,NULL,'Srta.',25,NULL),(100026,'Aguilar Zegarra','Cecilia Diana','29685823','Urb 15 de enero. Alto Buena Vista',435330,NULL,'Srta.',40,NULL),(100027,'Roller Rivera','Paola Karinna','29658280','Urb. ADEPA H-1',426376,9654125,'Srta.',25,NULL),(100028,'Quispe Pacheco','Amparo Consuelo','29618016','Urb. Campiña Dorada A-6',202898,9638521,'Srta.',15,NULL),(100029,'Meza Lovón','Graciela Lecireth','40222974','Urb. Cerro Colorado V-2',259176,NULL,'Sra.',25,NULL),(100030,'Benavides López','Sergio Fabrizio','41455724','Urb. Guardia Civil M-6',697399,NULL,'Sr.',NULL,NULL),(100031,'Quiroz Rodríguez','Larry Javier','29421573','Urb. Juventud Ferroviaria N-19',201636,NULL,'Sr.',35,NULL),(100032,'Lizárraga Delgado','Victor Abel','41228996','Urb. Lambramani A-17',283962,NULL,'Sr.',25,NULL),(100033,'Jaramillo Odam','Jenny',NULL,'Urb. Las Casuarinas E-16',253135,9624586,'Sra.',15,NULL),(100034,'Núñez Ampuero','Dante Enrique','29714904','Urb. Los Independientes B-4',251692,NULL,'Sr.',25,NULL),(100035,'Alcázar Belaunde','Joaquín Alonso',NULL,'Urb. Santa Sofia A-2',255634,NULL,'Sr.',35,NULL),(100036,'Jalsovec Sánchez','Ingrid Brusella','41085825','Urb. Señorial I-5',254785,NULL,'Srta.',40,NULL),(100037,'Calderón Aranibar','Mitchela Karin','40120646','Urb. Tahuaycani a-13',251276,9658741,'Sra.',25,NULL),(100038,'Valdivia Silva','Jessica','40136868','Urb. Victor Andrés Belaunde G-4',272589,NULL,'Sra.',35,NULL); /*!40000 ALTER TABLE `cliente` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `ejemplar` -- DROP TABLE IF EXISTS `ejemplar`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ejemplar` ( `pelcodigo` int(6) NOT NULL, `ejemnumero` int(3) NOT NULL, `ejemfecadq` date NOT NULL, `ejemfecbaja` date DEFAULT NULL, `ejemestado` varchar(45) DEFAULT 'B', `ejemidioma` int(11) DEFAULT NULL, `ejemsubtitu` int(11) DEFAULT NULL, PRIMARY KEY (`ejemnumero`,`pelcodigo`), KEY `fk_ejemplar_pelicula1_idx` (`pelcodigo`), KEY `fk_ejemplar_idioma1_idx` (`ejemidioma`), KEY `fk_ejemplar_idioma2_idx` (`ejemsubtitu`), CONSTRAINT `fk_ejemplar_idioma1` FOREIGN KEY (`ejemidioma`) REFERENCES `idioma` (`idiocodigo`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_ejemplar_idioma2` FOREIGN KEY (`ejemsubtitu`) REFERENCES `idioma` (`idiocodigo`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_ejemplar_pelicula1` FOREIGN KEY (`pelcodigo`) REFERENCES `pelicula` (`pelcodigo`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `ejemplar` -- LOCK TABLES `ejemplar` WRITE; /*!40000 ALTER TABLE `ejemplar` DISABLE KEYS */; INSERT INTO `ejemplar` VALUES (1001,1,'2001-05-16',NULL,'B',1,NULL),(1002,1,'2003-10-15',NULL,'B',3,1),(1003,1,'2001-05-16','2003-05-05','M',2,1),(1004,1,'2002-10-27',NULL,'B',2,1),(1005,1,'2003-10-15',NULL,'B',2,1),(1006,1,'2001-05-16',NULL,'B',1,NULL),(1007,1,'2001-05-16',NULL,'B',2,1),(1008,1,'2001-05-16',NULL,'B',1,NULL),(1009,1,'2003-10-15',NULL,'B',2,1),(1010,1,'2002-10-27',NULL,'B',2,1),(1011,1,'2003-01-03',NULL,'B',2,1),(1012,1,'2001-05-16',NULL,'B',1,NULL),(1013,1,'2001-05-16',NULL,'B',4,NULL),(1014,1,'2002-10-27',NULL,'B',4,1),(1015,1,'2001-05-16',NULL,'B',2,1),(1016,1,'2001-05-16',NULL,'R',2,1),(1017,1,'2002-10-27',NULL,'B',2,1),(1018,1,'2001-05-16',NULL,'B',1,NULL),(1019,1,'2001-05-16',NULL,'B',2,1),(1020,1,'2003-10-15',NULL,'B',2,1),(1001,2,'2002-10-27',NULL,'B',2,1),(1002,2,'2002-10-27',NULL,'B',1,NULL),(1003,2,'2001-05-16',NULL,'B',2,1),(1004,2,'2002-10-27',NULL,'B',2,1),(1005,2,'2003-10-15',NULL,'B',1,NULL),(1006,2,'2001-05-16',NULL,'B',1,NULL),(1007,2,'2002-10-27',NULL,'R',2,1),(1008,2,'2003-01-03',NULL,'B',1,NULL),(1010,2,'2002-10-27',NULL,'B',2,1),(1012,2,'2001-05-16','2003-07-16','M',1,NULL),(1013,2,'2003-01-03',NULL,'B',4,1),(1014,2,'2003-10-15',NULL,'B',1,NULL),(1015,2,'2001-05-16',NULL,'B',2,1),(1016,2,'2003-01-03',NULL,'B',1,NULL),(1017,2,'2003-10-15',NULL,'B',2,1),(1001,3,'2003-01-03',NULL,'B',2,1),(1003,3,'2003-01-03',NULL,'B',2,1),(1007,3,'2002-10-27',NULL,'B',2,1),(1013,3,'2002-10-27',NULL,'B',1,NULL),(1016,3,'2002-10-27',NULL,'B',2,1),(1007,4,'2001-05-16',NULL,'B',1,NULL); /*!40000 ALTER TABLE `ejemplar` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `genero` -- DROP TABLE IF EXISTS `genero`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `genero` ( `gencodigo` int(3) NOT NULL, `gennombre` varchar(45) DEFAULT NULL, PRIMARY KEY (`gencodigo`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `genero` -- LOCK TABLES `genero` WRITE; /*!40000 ALTER TABLE `genero` DISABLE KEYS */; INSERT INTO `genero` VALUES (1,'Drama'),(2,'Comedia'),(3,'Acción'),(4,'Ciencia Ficción'),(5,'Infantil'),(6,'Suspenso'); /*!40000 ALTER TABLE `genero` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `idioma` -- DROP TABLE IF EXISTS `idioma`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `idioma` ( `idiocodigo` int(11) NOT NULL, `idionombre` varchar(45) NOT NULL, PRIMARY KEY (`idiocodigo`), UNIQUE KEY `idionombre_UNIQUE` (`idionombre`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `idioma` -- LOCK TABLES `idioma` WRITE; /*!40000 ALTER TABLE `idioma` DISABLE KEYS */; INSERT INTO `idioma` VALUES (4,'Aleman'),(1,'Español'),(3,'Frances'),(2,'Ingles'),(5,'Italiano'),(8,'Japones'),(6,'Portugues'),(7,'Ruso'); /*!40000 ALTER TABLE `idioma` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `pais` -- DROP TABLE IF EXISTS `pais`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `pais` ( `paiscodigo` int(3) NOT NULL, `paisnombre` varchar(45) NOT NULL, `paisnacionalidad` varchar(45) NOT NULL, PRIMARY KEY (`paiscodigo`), UNIQUE KEY `paisnombre_UNIQUE` (`paisnombre`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `pais` -- LOCK TABLES `pais` WRITE; /*!40000 ALTER TABLE `pais` DISABLE KEYS */; INSERT INTO `pais` VALUES (101,'Perú','Peruana'),(102,'Estados Unidos','Estadounidense'),(103,'España','Española'),(104,'Argentina','Argentina'),(105,'Italia','Italiana'),(106,'Mexico','Mexicana'),(107,'Alemania','Alemana'); /*!40000 ALTER TABLE `pais` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `participacion` -- DROP TABLE IF EXISTS `participacion`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `participacion` ( `percodigo` int(11) NOT NULL, `pelcodigo` int(11) NOT NULL, `partipo` varchar(45) NOT NULL, KEY `fk_participacion_pelicula1_idx` (`pelcodigo`), KEY `fk_participacion_persona1_idx` (`percodigo`), CONSTRAINT `fk_participacion_1pelicula1` FOREIGN KEY (`pelcodigo`) REFERENCES `pelicula` (`pelcodigo`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_participacion_persona1` FOREIGN KEY (`percodigo`) REFERENCES `persona` (`percodigo`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `participacion` -- LOCK TABLES `participacion` WRITE; /*!40000 ALTER TABLE `participacion` DISABLE KEYS */; INSERT INTO `participacion` VALUES (25,1001,'A'),(38,1001,'A'),(36,1001,'D'),(3,1002,'A'),(15,1002,'A'),(11,1002,'D'),(22,1003,'A'),(34,1003,'A'),(21,1003,'D'),(39,1004,'A'),(27,1004,'A'),(28,1004,'D'),(33,1005,'A'),(8,1005,'A'),(31,1005,'D'),(9,1006,'A'),(6,1006,'D'),(26,1007,'A'),(12,1007,'D'),(7,1008,'A'),(35,1008,'A'),(10,1008,'D'),(17,1009,'A'),(23,1009,'A'),(20,1009,'D'),(14,1010,'A'),(21,1010,'D'),(19,1011,'A'),(32,1011,'A'),(19,1011,'D'),(30,1012,'A'),(35,1012,'A'),(1,1012,'D'),(18,1013,'A'),(29,1013,'D'),(5,1014,'A'),(2,1014,'A'),(4,1014,'D'),(13,1015,'A'),(16,1015,'A'),(28,1015,'D'),(37,1016,'A'),(24,1016,'A'),(21,1016,'D'),(37,1017,'A'),(37,1017,'D'),(37,1018,'A'),(36,1018,'D'),(37,1019,'A'),(28,1019,'D'),(13,1020,'A'),(12,1020,'D'); /*!40000 ALTER TABLE `participacion` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `pelicula` -- DROP TABLE IF EXISTS `pelicula`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `pelicula` ( `pelcodigo` int(6) NOT NULL, `pelnombre` varchar(45) NOT NULL, `pelgenero` int(3) NOT NULL, `pelresumen` text, `pelano` varchar(45) DEFAULT NULL, PRIMARY KEY (`pelcodigo`), KEY `fk_pelicula_genero_idx` (`pelgenero`), CONSTRAINT `fk_pelicula_genero` FOREIGN KEY (`pelgenero`) REFERENCES `genero` (`gencodigo`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `pelicula` -- LOCK TABLES `pelicula` WRITE; /*!40000 ALTER TABLE `pelicula` DISABLE KEYS */; INSERT INTO `pelicula` VALUES (1001,'Aquellos viejos tiempos / Old scholl',2,NULL,'2004'),(1002,'8 Mujeres / 8 femmes',6,NULL,'2002'),(1003,'Basico y Letal / Basic',3,NULL,'2003'),(1004,'Bad Boys 2 vuelven mas rebeldes',3,NULL,'2003'),(1005,'Abajo el amor',2,NULL,'2003'),(1006,'Corazón de Fuego',1,NULL,'2002'),(1007,'La estafa maestra',3,NULL,'2004'),(1008,'Paloma de Papel',1,NULL,'2004'),(1009,'Sendero de Sangre',3,NULL,'2002'),(1010,'Lizzie Mcguire',2,NULL,'2003'),(1011,'Identidad',6,NULL,'2003'),(1012,'El destino no tiene favoritos',2,NULL,'2004'),(1013,'Bowling For Columbine ',3,NULL,'2002'),(1014,'Desafio extremo',3,NULL,'2002'),(1015,'Mejor Imposible',1,NULL,'1999'),(1016,'Atrápame si puedes',2,NULL,'2001'),(1017,'Naufrago',1,NULL,'1998'),(1018,'Filadelfia',1,NULL,'1992'),(1019,'Apollo XIII',3,NULL,'1993'),(1020,'Tornado',3,NULL,'1998'); /*!40000 ALTER TABLE `pelicula` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `persona` -- DROP TABLE IF EXISTS `persona`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `persona` ( `percodigo` int(11) NOT NULL, `pernombre` varchar(45) NOT NULL, `perapellido` varchar(45) NOT NULL, `pernacion` int(11) DEFAULT NULL, `persexo` varchar(45) NOT NULL, `perfecnac` date NOT NULL, `perfecfal` date DEFAULT NULL, PRIMARY KEY (`percodigo`), KEY `fk_persona_pais1_idx` (`pernacion`), CONSTRAINT `fk_persona_pais1` FOREIGN KEY (`pernacion`) REFERENCES `pais` (`paiscodigo`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `persona` -- LOCK TABLES `persona` WRITE; /*!40000 ALTER TABLE `persona` DISABLE KEYS */; INSERT INTO `persona` VALUES (1,'Alvaro','Velarde',101,'M','1968-06-21',NULL),(2,'Bridgette','Wilson-Sampras',107,'F','1970-11-11',NULL),(3,'Catherine','Deneuve',102,'F','1954-02-19',NULL),(4,'Christian','Duguay',107,'M','1969-10-22',NULL),(5,'Devon','Sawa',107,'M','1969-08-05',NULL),(6,'Diego','Arsuaga',104,'M','1966-04-13',NULL),(7,'Diego','Bertie',101,'M','1969-12-30',NULL),(8,'Ewar','McGregor',102,'M','1962-09-02',NULL),(9,'Federico','Luppi',104,'M','1954-01-23',NULL),(10,'Francisco','Lombardi',101,'M','1946-07-14',NULL),(11,'Francois','Ozon',102,'M','1961-10-31',NULL),(12,'Gary','Gray',102,'M','1960-06-17',NULL),(13,'Helen','Hunt',102,'F','1966-05-27',NULL),(14,'Hilary','Duff',102,'F','1968-09-28',NULL),(15,'Isabelle','Huppert',102,'F','1968-03-22',NULL),(16,'Jack','Nicholson',102,'M','1943-10-12',NULL),(17,'Javier','Bardem',102,'M','1962-10-07',NULL),(18,'Jeff','Gibs',107,'M','1967-07-04',NULL),(19,'John','Cusack',102,'M','1953-06-09',NULL),(20,'John','Malkovich',102,'M','1942-03-06',NULL),(21,'John','Mc Tiernan',102,'M','1959-08-26',NULL),(22,'John','Travolta',102,'M','1959-07-03',NULL),(23,'Juan Diego','Botto',106,'M','1962-11-05',NULL),(24,'Leonardo','D Caprio',102,'M','1974-08-23',NULL),(25,'Luke','Wilson',102,'M','1958-05-16',NULL),(26,'Mark','Whalberg',102,'M','1964-11-20',NULL),(27,'Martin','Lawrence',102,'M','1951-12-29',NULL),(28,'Michael','Bay',102,'M','1958-07-27',NULL),(29,'Michael','Moore',107,'M','1963-12-09','2002-03-29'),(30,'Paul','Vega',101,'M','1967-02-28',NULL),(31,'Peyton','Reed',102,'M','1960-04-23',NULL),(32,'Ray','Liotta',105,'M','1947-06-24','1999-08-16'),(33,'Reneé','Zellweger',102,'F','1976-03-10',NULL),(34,'Samuel','Jackson',102,'M','1955-04-01',NULL),(35,'Tatiana','Astengo',101,'F','1977-07-25',NULL),(36,'Todd','Phillips',102,'M','1965-06-15',NULL),(37,'Tom','Hanks',102,'M','1952-10-16',NULL),(38,'Hill','Ferrell',102,'M','1970-04-18',NULL),(39,'Willi','Smith',102,'M','1959-09-18',NULL); /*!40000 ALTER TABLE `persona` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `prestamo_cabecera` -- DROP TABLE IF EXISTS `prestamo_cabecera`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `prestamo_cabecera` ( `presnumero` int(6) NOT NULL, `presfecha` date NOT NULL, `clicodigo` int(6) DEFAULT NULL, PRIMARY KEY (`presnumero`), KEY `fk_prestamo_cabecera_cliente1_idx` (`clicodigo`), CONSTRAINT `fk_prestamo_cabecera_cliente1` FOREIGN KEY (`clicodigo`) REFERENCES `cliente` (`clicodigo`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `prestamo_cabecera` -- LOCK TABLES `prestamo_cabecera` WRITE; /*!40000 ALTER TABLE `prestamo_cabecera` DISABLE KEYS */; INSERT INTO `prestamo_cabecera` VALUES (501,'2003-03-21',100033),(502,'2003-03-21',100022),(503,'2003-03-21',100038),(504,'2003-03-22',100016),(505,'2003-03-22',100037),(506,'2003-03-22',100010),(507,'2003-03-22',100027),(508,'2003-03-22',100036),(509,'2003-03-23',100009),(510,'2003-03-23',100038),(511,'2003-03-23',100022),(512,'2003-03-23',100012),(513,'2003-03-24',100034),(514,'2003-03-24',100007),(515,'2003-03-24',100023),(516,'2003-03-24',100031),(517,'2003-03-24',100021),(518,'2003-03-24',100036),(519,'2003-03-25',100014),(520,'2003-03-25',100010),(521,'2003-03-25',100028),(522,'2003-03-26',100031),(523,'2003-03-26',100032),(524,'2003-03-26',100013),(525,'2003-03-26',100001),(526,'2003-03-26',100021),(527,'2003-03-27',100001),(528,'2003-03-27',100013),(529,'2003-03-27',100026),(530,'2003-03-27',100022),(531,'2003-03-28',100002),(532,'2003-03-28',100002),(533,'2003-03-28',100006),(534,'2003-03-28',100028),(535,'2003-03-28',100016),(536,'2003-03-28',100022),(537,'2003-03-29',100020),(538,'2003-03-29',100006),(539,'2003-03-29',100037),(540,'2003-03-30',100017),(541,'2003-03-30',100009),(542,'2003-03-30',100031),(543,'2003-03-30',100021),(544,'2003-03-30',100036),(545,'2003-03-30',100012),(546,'2003-03-31',100014),(547,'2003-03-31',100005),(548,'2003-03-31',100038),(549,'2003-03-31',100020),(550,'2003-03-31',100034),(551,'2003-04-01',100010),(552,'2003-04-01',100028),(553,'2003-04-01',100018),(554,'2003-04-01',100020),(555,'2003-04-01',100033),(556,'2003-04-02',100037),(557,'2003-04-02',100012),(558,'2003-04-02',100018),(559,'2003-04-02',100034),(560,'2003-04-02',100026),(561,'2003-04-02',100032),(562,'2003-04-02',100010),(563,'2003-04-03',100034),(564,'2003-04-03',100013),(565,'2003-04-03',100002),(566,'2003-04-03',100017),(567,'2003-04-04',100033),(568,'2003-04-04',100031),(569,'2003-04-04',100001),(570,'2003-04-04',100012),(571,'2003-04-04',100027),(572,'2003-04-05',100006),(573,'2003-04-05',100027),(574,'2003-04-05',100023),(575,'2003-04-05',100033),(576,'2003-04-05',100023),(577,'2003-04-05',100007),(578,'2003-04-06',100021),(579,'2003-04-06',100020),(580,'2003-04-06',100007),(581,'2003-04-06',100037),(582,'2003-04-07',100002),(583,'2003-04-07',100018),(584,'2003-04-07',100014),(585,'2003-04-08',100001),(586,'2003-04-08',100037),(587,'2003-04-08',100014),(588,'2003-04-08',100009),(589,'2003-04-08',100038),(590,'2003-04-09',100012),(591,'2003-04-09',100013),(592,'2003-04-09',100023),(593,'2003-04-09',100005),(594,'2003-04-10',100026),(595,'2003-04-10',100028),(596,'2003-04-10',100032),(597,'2003-04-10',100021),(598,'2003-04-10',100005),(599,'2003-04-11',100020),(600,'2003-04-11',100016),(601,'2003-04-12',100009),(602,'2003-04-12',100016),(603,'2003-04-12',100038),(604,'2003-04-12',100017); /*!40000 ALTER TABLE `prestamo_cabecera` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `prestamo_detalle` -- DROP TABLE IF EXISTS `prestamo_detalle`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `prestamo_detalle` ( `presnumero` int(6) NOT NULL, `presitem` int(2) NOT NULL, `pelcodigo` int(3) NOT NULL, `ejemnumero` int(3) NOT NULL, `presfecdepac` date DEFAULT NULL, `presfecdereal` date DEFAULT NULL, `presimporte` float(6,2) DEFAULT NULL, PRIMARY KEY (`presnumero`,`presitem`), KEY `fk_prestamo_detalle_prestamo_cabecera1_idx` (`presnumero`), KEY `fk_prestamo_detalle_ejemplar1_idx` (`ejemnumero`,`pelcodigo`), CONSTRAINT `fk_prestamo_detalle_ejemplar1` FOREIGN KEY (`ejemnumero`, `pelcodigo`) REFERENCES `ejemplar` (`ejemnumero`, `pelcodigo`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_prestamo_detalle_prestamo_cabecera1` FOREIGN KEY (`presnumero`) REFERENCES `prestamo_cabecera` (`presnumero`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `prestamo_detalle` -- LOCK TABLES `prestamo_detalle` WRITE; /*!40000 ALTER TABLE `prestamo_detalle` DISABLE KEYS */; INSERT INTO `prestamo_detalle` VALUES (501,1,1002,1,'2003-03-22','2003-03-22',4.50),(502,1,1005,1,'2003-03-22','2003-03-22',4.50),(502,2,1019,1,'2003-03-22','2003-03-22',4.50),(503,1,1001,1,'2003-03-22','2003-03-22',4.50),(504,1,1004,1,'2003-03-23','2003-03-23',4.50),(505,1,1003,2,'2003-03-23','2003-03-24',9.00),(505,2,1013,3,'2003-03-23','2003-03-23',4.50),(505,3,1006,2,'2003-03-23','2003-03-23',4.50),(506,1,1016,1,'2003-03-23','2003-03-23',4.50),(507,1,1014,2,'2003-03-23','2003-03-23',4.50),(508,1,1012,1,'2003-03-23','2003-03-23',4.50),(508,2,1018,1,'2003-03-23','2003-03-23',4.50),(509,1,1011,1,'2003-03-24','2003-03-25',9.00),(510,1,1007,2,'2003-03-24','2003-03-24',4.50),(511,1,1010,2,'2003-03-24','2003-03-24',4.50),(511,2,1015,2,'2003-03-24','2003-03-24',4.50),(512,1,1017,1,'2003-03-24','2003-03-24',4.50),(513,1,1008,2,'2003-03-25','2003-03-26',9.00),(513,2,1009,1,'2003-03-25','2003-03-26',9.00),(514,1,1020,1,'2003-03-25','2003-03-26',9.00),(515,1,1005,1,'2003-03-25','2003-03-25',4.50),(516,1,1019,1,'2003-03-25','2003-03-25',4.50),(516,2,1003,3,'2003-03-25','2003-03-25',4.50),(517,1,1013,3,'2003-03-25','2003-03-25',4.50),(517,2,1006,1,'2003-03-25','2003-03-25',4.50),(518,1,1016,2,'2003-03-25','2003-03-25',4.50),(519,1,1014,2,'2003-03-26','2003-03-26',4.50),(520,1,1012,2,'2003-03-26','2003-03-27',9.00),(520,2,1018,1,'2003-03-26','2003-03-26',4.50),(520,3,1011,1,'2003-03-26','2003-03-26',4.50),(521,1,1007,3,'2003-03-26','2003-03-26',4.50),(522,1,1010,2,'2003-03-27','2003-03-27',4.50),(522,2,1008,1,'2003-03-27','2003-03-28',9.00),(523,1,1009,1,'2003-03-27','2003-03-27',4.50),(524,1,1020,1,'2003-03-27','2003-03-27',4.50),(525,1,1002,2,'2003-03-27','2003-03-27',4.50),(525,2,1005,1,'2003-03-27','2003-03-27',4.50),(525,3,1019,1,'2003-03-27','2003-03-29',13.50),(526,1,1001,3,'2003-03-27','2003-03-27',4.50),(527,1,1004,2,'2003-03-28','2003-03-28',4.50),(527,2,1003,1,'2003-03-28','2003-03-28',4.50),(528,1,1016,2,'2003-03-28','2003-03-29',9.00),(529,1,1014,2,'2003-03-28','2003-03-28',4.50),(530,1,1012,2,'2003-03-28','2003-03-28',4.50),(530,2,1018,1,'2003-03-28','2003-03-28',4.50),(530,3,1007,2,'2003-03-28','2003-03-28',4.50),(530,4,1010,2,'2003-03-28','2003-03-28',4.50),(531,1,1015,1,'2003-03-29','2003-03-30',9.00),(531,2,1017,1,'2003-03-29','2003-03-30',9.00),(532,1,1008,2,'2003-03-29','2003-03-29',4.50),(532,2,1009,1,'2003-03-29','2003-03-29',4.50),(533,1,1002,2,'2003-03-29','2003-03-29',4.50),(534,1,1005,1,'2003-03-29','2003-03-29',4.50),(535,1,1001,2,'2003-03-29','2003-03-29',4.50),(535,2,1004,2,'2003-03-29','2003-03-29',4.50),(536,1,1003,3,'2003-03-29','2003-03-29',4.50),(537,1,1006,1,'2003-03-30','2003-03-30',4.50),(538,1,1016,2,'2003-03-30','2003-03-30',4.50),(538,2,1012,2,'2003-03-30','2003-03-31',9.00),(539,1,1018,1,'2003-03-30','2003-03-30',4.50),(540,1,1011,1,'2003-03-31','2003-03-31',4.50),(540,2,1010,2,'2003-03-31','2003-03-31',4.50),(540,3,1015,2,'2003-03-31','2003-03-31',4.50),(541,1,1009,1,'2003-03-31','2003-04-01',9.00),(542,1,1020,1,'2003-03-31','2003-03-31',4.50),(542,2,1005,2,'2003-03-31','2003-03-31',4.50),(542,3,1019,1,'2003-03-31','2003-03-31',4.50),(543,1,1003,3,'2003-03-31','2003-03-31',4.50),(543,2,1013,1,'2003-03-31','2003-03-31',4.50),(543,3,1006,2,'2003-03-31','2003-03-31',4.50),(544,1,1016,3,'2003-03-31','2003-03-31',4.50),(545,1,1012,2,'2003-03-31','2003-03-31',4.50),(545,2,1018,1,'2003-03-31','2003-03-31',4.50),(546,1,1011,1,'2003-04-01','2003-04-01',4.50),(547,1,1007,3,'2003-04-01','2003-04-02',9.00),(547,2,1010,2,'2003-04-01','2003-04-01',4.50),(547,3,1015,1,'2003-04-01','2003-04-01',4.50),(547,4,1017,2,'2003-04-01','2003-04-01',4.50),(548,1,1009,1,'2003-04-01','2003-04-01',4.50),(548,2,1020,1,'2003-04-01','2003-04-01',4.50),(549,1,1005,1,'2003-04-01','2003-04-01',4.50),(549,2,1019,1,'2003-04-01','2003-04-01',4.50),(550,1,1001,3,'2003-04-01','2003-04-01',4.50),(550,2,1003,3,'2003-04-01','2003-04-01',4.50),(551,1,1016,1,'2003-04-02','2003-04-02',4.50),(552,1,1014,2,'2003-04-02','2003-04-02',4.50),(552,2,1012,2,'2003-04-02','2003-04-02',4.50),(553,1,1018,1,'2003-04-02','2003-04-02',4.50),(554,1,1011,1,'2003-04-02','2003-04-02',4.50),(554,2,1007,2,'2003-04-02','2003-04-03',9.00),(555,1,1010,2,'2003-04-02','2003-04-02',4.50),(556,1,1017,2,'2003-04-03','2003-04-03',4.50),(557,1,1008,1,'2003-04-03','2003-04-03',4.50),(558,1,1009,1,'2003-04-03','2003-04-03',4.50),(558,2,1002,2,'2003-04-03','2003-04-05',13.50),(559,1,1005,2,'2003-04-03','2003-04-03',4.50),(560,1,1001,1,'2003-04-03','2003-04-03',4.50),(560,2,1004,2,'2003-04-03','2003-04-03',4.50),(561,1,1013,3,'2003-04-03','2003-04-03',4.50),(562,1,1006,2,'2003-04-03','2003-04-03',4.50),(562,2,1014,1,'2003-04-03','2003-04-03',4.50),(563,1,1012,2,'2003-04-04','2003-04-04',4.50),(563,2,1011,1,'2003-04-04','2003-04-04',4.50),(564,1,1007,4,'2003-04-04','2003-04-05',9.00),(565,1,1010,1,'2003-04-04','2003-04-04',4.50),(566,1,1017,2,'2003-04-04','2003-04-04',4.50),(567,1,1002,2,'2003-04-05','2003-04-05',4.50),(567,2,1005,2,'2003-04-05','2003-04-05',4.50),(568,1,1019,1,'2003-04-05','2003-04-05',4.50),(569,1,1001,2,'2003-04-05','2003-04-05',4.50),(569,2,1004,2,'2003-04-05','2003-04-05',4.50),(569,3,1003,3,'2003-04-05','2003-04-05',4.50),(570,1,1013,1,'2003-04-05','2003-04-05',4.50),(571,1,1006,2,'2003-04-05','2003-04-06',9.00),(571,2,1016,3,'2003-04-05','2003-04-05',4.50),(572,1,1014,2,'2003-04-06','2003-04-06',4.50),(572,2,1012,1,'2003-04-06','2003-04-06',4.50),(573,1,1018,1,'2003-04-06','2003-04-06',4.50),(574,1,1011,1,'2003-04-06','2003-04-07',9.00),(574,2,1007,4,'2003-04-06','2003-04-07',9.00),(574,3,1010,1,'2003-04-06','2003-04-06',4.50),(575,1,1015,2,'2003-04-06','2003-04-06',4.50),(576,1,1017,2,'2003-04-06','2003-04-06',4.50),(576,2,1008,2,'2003-04-06','2003-04-06',4.50),(576,3,1009,1,'2003-04-06','2003-04-06',4.50),(577,1,1020,1,'2003-04-06','2003-04-06',4.50),(577,2,1005,2,'2003-04-06','2003-04-06',4.50),(577,3,1019,1,'2003-04-06','2003-04-06',4.50),(578,1,1003,1,'2003-04-07','2003-04-07',4.50),(579,1,1013,2,'2003-04-07','2003-04-07',4.50),(580,1,1006,2,'2003-04-07','2003-04-07',4.50),(580,2,1016,3,'2003-04-07','2003-04-07',4.50),(581,1,1014,1,'2003-04-07','2003-04-08',9.00),(582,1,1012,2,'2003-04-08','2003-04-08',4.50),(583,1,1018,1,'2003-04-08','2003-04-08',4.50),(583,2,1011,1,'2003-04-08','2003-04-08',4.50),(584,1,1007,1,'2003-04-08','2003-04-08',4.50),(584,2,1010,2,'2003-04-08','2003-04-08',4.50),(585,1,1008,1,'2003-04-09','2003-04-09',4.50),(586,1,1009,1,'2003-04-09','2003-04-09',4.50),(587,1,1020,1,'2003-04-09','2003-04-09',4.50),(587,2,1002,2,'2003-04-09','2003-04-09',4.50),(588,1,1005,2,'2003-04-09','2003-04-09',4.50),(589,1,1019,1,'2003-04-09','2003-04-09',4.50),(589,2,1001,1,'2003-04-09','2003-04-09',4.50),(590,1,1004,2,'2003-04-10','2003-04-10',4.50),(591,1,1003,3,'2003-04-10','2003-04-10',4.50),(591,2,1016,3,'2003-04-10','2003-04-10',4.50),(591,3,1014,1,'2003-04-10','2003-04-11',9.00),(592,1,1012,2,'2003-04-10','2003-04-10',4.50),(593,1,1018,1,'2003-04-10','2003-04-10',4.50),(594,1,1007,4,'2003-04-11','2003-04-11',4.50),(594,2,1010,1,'2003-04-11','2003-04-11',4.50),(594,3,1015,2,'2003-04-11','2003-04-11',4.50),(595,1,1017,2,'2003-04-11','2003-04-11',4.50),(596,1,1008,2,'2003-04-11','2003-04-11',4.50),(597,1,1009,1,'2003-04-11','2003-04-11',4.50),(597,2,1002,2,'2003-04-11','2003-04-12',9.00),(598,1,1005,2,'2003-04-11','2003-04-11',4.50),(599,1,1001,3,'2003-04-12','2003-04-12',4.50),(600,1,1004,1,'2003-04-12','2003-04-12',4.50),(600,2,1003,2,'2003-04-12','2003-04-12',4.50),(601,1,1006,2,'2003-04-13',NULL,NULL),(602,1,1016,3,'2003-04-13','2003-04-13',4.50),(602,2,1012,1,'2003-04-13','2003-04-14',9.00),(603,1,1018,1,'2003-04-13',NULL,NULL),(604,1,1011,1,'2003-04-13','2003-04-13',4.50); /*!40000 ALTER TABLE `prestamo_detalle` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2018-07-31 23:07:38
Share This