/* SQLyog Community Edition- MySQL GUI v6.05 Host - 5.0.24a-community-nt-log : Database - eventos ********************************************************************* Server version : 5.0.24a-community-nt-log */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; create database if not exists `eventos`; USE `eventos`; /*!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' */; /*Table structure for table `admin` */ DROP TABLE IF EXISTS `admin`; CREATE TABLE `admin` ( `cod_admin` decimal(10,0) NOT NULL default '0', `usuario` varchar(15) NOT NULL, `clave` varchar(10) NOT NULL default '', `nombre` varchar(30) NOT NULL default '', `apellido` varchar(30) NOT NULL default '', PRIMARY KEY (`cod_admin`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; /*Data for the table `admin` */ insert into `admin`(`cod_admin`,`usuario`,`clave`,`nombre`,`apellido`) values ('1','apache','100','juan carlos','leon'),('2','php','admin','php','proyecto'); /*Table structure for table `categoria` */ DROP TABLE IF EXISTS `categoria`; CREATE TABLE `categoria` ( `cod_categoria` decimal(10,0) NOT NULL, `nombre` varchar(30) NOT NULL, `descripcion` varchar(100) NOT NULL, PRIMARY KEY (`cod_categoria`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; /*Data for the table `categoria` */ insert into `categoria`(`cod_categoria`,`nombre`,`descripcion`) values ('101','Festival','Evento Festival'),('102','Deportes','Eventos Deportivos'),('103','Teatro','Eventos teatrales'),('107','Intregraciones','Integraciones De La Universidad Y Sus Facultades.\r\nCon Actualizacion.'),('108','Herencias','Reparticion De Herencias Entres Hermanos, Esposas, Y Familiares en general.'),('109','Eventos Politicos','Para ganar votos.'); /*Table structure for table `categorias` */ DROP TABLE IF EXISTS `categorias`; /*!50001 DROP VIEW IF EXISTS `categorias` */; /*!50001 DROP TABLE IF EXISTS `categorias` */; /*!50001 CREATE TABLE `categorias` ( `cod` decimal(10,0) NOT NULL, `nombre` varchar(30) NOT NULL, `descripcion` varchar(100) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 */; /*Table structure for table `evento` */ DROP TABLE IF EXISTS `evento`; /*!50001 DROP VIEW IF EXISTS `evento` */; /*!50001 DROP TABLE IF EXISTS `evento` */; /*!50001 CREATE TABLE `evento` ( `cod_evento` decimal(10,0) NOT NULL, `titulo` varchar(30) NOT NULL, `descripcion` varchar(150) NOT NULL, `fecha` date NOT NULL, `hora` varchar(10) NOT NULL, `cod_categoria` decimal(10,0) NOT NULL, `cod_admin` decimal(10,0) NOT NULL, `lugar` varchar(50) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 */; /*Table structure for table `eventos` */ DROP TABLE IF EXISTS `eventos`; CREATE TABLE `eventos` ( `cod_evento` decimal(10,0) NOT NULL, `fecha` date NOT NULL, `titulo` varchar(30) NOT NULL, `descripcion` varchar(150) NOT NULL, `hora` varchar(10) NOT NULL, `lugar` varchar(50) NOT NULL, `cod_categoria` decimal(10,0) NOT NULL, `cod_admin` decimal(10,0) NOT NULL, PRIMARY KEY (`cod_evento`), KEY `cod_categoria` (`cod_categoria`), KEY `cod_admin` (`cod_admin`), CONSTRAINT `FK_eventos` FOREIGN KEY (`cod_categoria`) REFERENCES `categoria` (`cod_categoria`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `FK_eventos23` FOREIGN KEY (`cod_admin`) REFERENCES `admin` (`cod_admin`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; /*Data for the table `eventos` */ insert into `eventos`(`cod_evento`,`fecha`,`titulo`,`descripcion`,`hora`,`lugar`,`cod_categoria`,`cod_admin`) values ('101','2007-12-03','Concierto','Concierto Para Todos.','11:00','Plazoleta','101','1'),('102','2007-10-24','Cumpleaños','Cumpleaños de Pele','10:00','Hotel Hilton Miami','101','1'),('103','2007-11-12','Herencia','Reparticion De La Herencia','10:00am','Despacho','108','1'),('104','0000-00-00','Colombia','CineArte','2:00pm','Auditorio','103','1'),('105','2007-12-25','kjhkljhkhkj','hkjhkjh','10','lkjlkj','102','2'),('106','2007-11-12','Covocatoria de egresados','Keremos reunir a todos nuestros egresados con el fin de fortalecer nuestra asociación','14:00','Universidad Libre','107','1'),('107','2007-12-14','safkjhsdfskjhº','khkjhkjhkj','10:00','kjh ','102','2'),('108','2007-11-12','rrrrrrrrrrrrrrrrrrrrrrrrrrr','hhhhhhhhhhhhhhhhhhh','14:00','fdfd','103','1'),('109','2007-12-14','ljlkjlkjºlkjlk','lkjljlkjljlk','10:00','lkjlkj','107','2'); /*Table structure for table `eventoxadmin` */ DROP TABLE IF EXISTS `eventoxadmin`; CREATE TABLE `eventoxadmin` ( `cod_admin` decimal(10,0) NOT NULL, `cod_eventos` decimal(10,0) NOT NULL, PRIMARY KEY (`cod_admin`,`cod_eventos`), KEY `FK_eventoxadmin2` (`cod_eventos`), CONSTRAINT `FK_eventoxadmin` FOREIGN KEY (`cod_admin`) REFERENCES `admin` (`cod_admin`), CONSTRAINT `FK_eventoxadmin2` FOREIGN KEY (`cod_eventos`) REFERENCES `eventos` (`cod_evento`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; /*Data for the table `eventoxadmin` */ /*Table structure for table `maxcodcategoria` */ DROP TABLE IF EXISTS `maxcodcategoria`; /*!50001 DROP VIEW IF EXISTS `maxcodcategoria` */; /*!50001 DROP TABLE IF EXISTS `maxcodcategoria` */; /*!50001 CREATE TABLE `maxcodcategoria` ( `cod` decimal(11,0) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 */; /*Table structure for table `maxcodeventos` */ DROP TABLE IF EXISTS `maxcodeventos`; /*!50001 DROP VIEW IF EXISTS `maxcodeventos` */; /*!50001 DROP TABLE IF EXISTS `maxcodeventos` */; /*!50001 CREATE TABLE `maxcodeventos` ( `cod` decimal(11,0) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 */; /*Table structure for table `sessions` */ DROP TABLE IF EXISTS `sessions`; CREATE TABLE `sessions` ( `session_id` varchar(100) NOT NULL default '', `session_data` text NOT NULL, `expires` int(11) NOT NULL default '0', `ip` varchar(12) NOT NULL, PRIMARY KEY (`session_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `sessions` */ insert into `sessions`(`session_id`,`session_data`,`expires`,`ip`) values ('83e3e44564a1a4e61d55a33ed1da4de0','1',1194294927,'192.168.1.4'); /*View structure for view categorias */ /*!50001 DROP TABLE IF EXISTS `categorias` */; /*!50001 DROP VIEW IF EXISTS `categorias` */; /*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `categorias` AS (select `categoria`.`cod_categoria` AS `cod`,`categoria`.`nombre` AS `nombre`,`categoria`.`descripcion` AS `descripcion` from `categoria`) */; /*View structure for view evento */ /*!50001 DROP TABLE IF EXISTS `evento` */; /*!50001 DROP VIEW IF EXISTS `evento` */; /*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `evento` AS (select `cod_evento` AS `cod_evento`,`titulo` AS `titulo`,`descripcion` AS `descripcion`,`fecha` AS `fecha`,`hora` AS `hora`,`cod_categoria` AS `cod_categoria`,`cod_admin` AS `cod_admin`,`lugar` AS `lugar` from `eventos`) */; /*View structure for view maxcodcategoria */ /*!50001 DROP TABLE IF EXISTS `maxcodcategoria` */; /*!50001 DROP VIEW IF EXISTS `maxcodcategoria` */; /*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `maxcodcategoria` AS (select max((`categoria`.`cod_categoria` + 1)) AS `cod` from `categoria`) */; /*View structure for view maxcodeventos */ /*!50001 DROP TABLE IF EXISTS `maxcodeventos` */; /*!50001 DROP VIEW IF EXISTS `maxcodeventos` */; /*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `maxcodeventos` AS (select max((`cod_evento` + 1)) AS `cod` from `eventos`) */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;