Advertisement
Guest User

SQL estructura

a guest
Jul 9th, 2014
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 6.56 KB | None | 0 0
  1. /*
  2. SQLyog Ultimate v11.28 (32 bit)
  3. MySQL - 5.0.51b-community-nt-log : Database - fazunp
  4. *********************************************************************
  5. */
  6.  
  7.  
  8. /*!40101 SET NAMES utf8 */;
  9.  
  10. /*!40101 SET SQL_MODE=''*/;
  11.  
  12. /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
  13. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  14. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  15. /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  16. CREATE DATABASE /*!32312 IF NOT EXISTS*/`fazunp` /*!40100 DEFAULT CHARACTER SET utf8 */;
  17.  
  18. /*Table structure for table `produccion` */
  19.  
  20. DROP TABLE IF EXISTS `produccion`;
  21.  
  22. CREATE TABLE `produccion` (
  23.   `id` int(10) NOT NULL auto_increment,
  24.   `codigo` int(10) NOT NULL,
  25.   `fecha` date default NULL,
  26.   `mañana` longtext,
  27.   `tarde` longtext,
  28.   `total` longtext,
  29.   `error` varchar(30) default NULL,
  30.   `tipo` varchar(10) default NULL,
  31.   `observacion` varchar(300) default NULL,
  32.   `densidad_m` varchar(10) default NULL,
  33.   `densidad_t` varchar(10) default NULL,
  34.   `densidad_total` varchar(10) default NULL,
  35.   `unidad` varchar(10) default NULL,
  36.   `camp` varchar(2) default NULL,
  37.   PRIMARY KEY  (`id`),
  38.   KEY `codigo` (`codigo`),
  39.   CONSTRAINT `produccion_ibfk_1` FOREIGN KEY (`codigo`) REFERENCES `vacunos` (`codigo`) ON DELETE CASCADE ON UPDATE CASCADE
  40. ) ENGINE=InnoDB AUTO_INCREMENT=157 DEFAULT CHARSET=utf8;
  41.  
  42. /*Data for the table `produccion` */
  43.  
  44.  
  45. /*Table structure for table `reproduccion` */
  46.  
  47. DROP TABLE IF EXISTS `reproduccion`;
  48.  
  49. CREATE TABLE `reproduccion` (
  50.   `id` int(10) unsigned NOT NULL auto_increment,
  51.   `codigo` int(10) unsigned NOT NULL,
  52.   `Servicio` int(10) unsigned NOT NULL,
  53.   `diagnostico` int(10) unsigned NOT NULL,
  54.   `Parto` int(10) unsigned NOT NULL,
  55.   `aborto` int(10) unsigned NOT NULL,
  56.   `numero` varchar(10) NOT NULL,
  57.   PRIMARY KEY  (`id`),
  58.   KEY `codigo` (`codigo`),
  59.   KEY `diagnostico` (`diagnostico`),
  60.   KEY `parto` (`Parto`),
  61.   KEY `aborto` (`aborto`),
  62.   KEY `servicio` (`Servicio`),
  63.   CONSTRAINT `reproduccion_ibfk_1` FOREIGN KEY (`Servicio`) REFERENCES `servicios` (`Servicio`) ON DELETE CASCADE ON UPDATE CASCADE
  64. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  65.  
  66. /*Data for the table `reproduccion` */
  67.  
  68. /*Table structure for table `servicios` */
  69.  
  70. DROP TABLE IF EXISTS `servicios`;
  71.  
  72. CREATE TABLE `servicios` (
  73.   `id` int(10) NOT NULL auto_increment,
  74.   `Servicio` int(10) unsigned NOT NULL,
  75.   `vacunocod` int(10) default NULL,
  76.   `fecha` date default NULL,
  77.   `hora` time default NULL,
  78.   `tipo` varchar(100) default NULL,
  79.   `toro` varchar(50) default NULL,
  80.   `operador` varchar(100) default NULL,
  81.   `observacion` longtext,
  82.   PRIMARY KEY  (`id`),
  83.   KEY `Servicio` (`Servicio`)
  84. ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
  85.  
  86. /*Data for the table `servicios` */
  87.  
  88.  
  89. /*Table structure for table `abortos` */
  90.  
  91. DROP TABLE IF EXISTS `abortos`;
  92.  
  93. CREATE TABLE `abortos` (
  94.   `id` tinyint(4) NOT NULL auto_increment,
  95.   `codigo` varchar(10) NOT NULL,
  96.   `fecha` date default NULL,
  97.   `operador` varchar(100) default NULL,
  98.   `observacion` text NOT NULL,
  99.   UNIQUE KEY `id` (`id`)
  100. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
  101.  
  102. /*Data for the table `abortos` */
  103.  
  104. /*Table structure for table `campanas` */
  105.  
  106. DROP TABLE IF EXISTS `diag`;
  107.  
  108. CREATE TABLE `diag` (
  109.   `diagnosticoid` tinyint(4) NOT NULL auto_increment,
  110.   `vacunocod` tinyint(4) default NULL,
  111.   `fecha` date default NULL,
  112.   `veterinario` varchar(100) default NULL,
  113.   `preñez` varchar(10) default NULL,
  114.   `fpparto` date default NULL,
  115.   `observacion` longtext,
  116.   PRIMARY KEY  (`diagnosticoid`)
  117. ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
  118.  
  119. /*Data for the table `diag` */
  120.  
  121. /*Table structure for table `parto` */
  122.  
  123. DROP TABLE IF EXISTS `parto`;
  124.  
  125. CREATE TABLE `parto` (
  126.   `partoid` tinyint(4) NOT NULL auto_increment,
  127.   `vacunocod` tinyint(4) default NULL,
  128.   `fecha` date default NULL,
  129.   `sexo` varchar(10) default NULL,
  130.   `operador` varchar(100) default NULL,
  131.   `hijocod` varchar(10) default NULL,
  132.   `observacion` longtext,
  133.   PRIMARY KEY  (`partoid`)
  134. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  135.  
  136. /*Data for the table `parto` */
  137.  
  138.  
  139. /*Table structure for table `sanidad` */
  140.  
  141. DROP TABLE IF EXISTS `sanidad`;
  142.  
  143. CREATE TABLE `sanidad` (
  144.   `id` tinyint(4) NOT NULL auto_increment,
  145.   `vacunocod` varchar(10) default NULL,
  146.   `control` varchar(50) default NULL,
  147.   `fecha` date default NULL,
  148.   `edad` varchar(20) default NULL,
  149.   `tratamiento` varchar(100) default NULL,
  150.   `dosis` varchar(100) default NULL,
  151.   `operador` varchar(100) default NULL,
  152.   `reporte` text,
  153.   `programar` varchar(10) default NULL,
  154.   `realizo` varchar(10) default NULL,
  155.   KEY `id` (`id`)
  156. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
  157.  
  158. /*Data for the table `sanidad` */
  159.  
  160. /*Table structure for table `sanidad_control` */
  161.  
  162. DROP TABLE IF EXISTS `sanidad_control`;
  163.  
  164. CREATE TABLE `sanidad_control` (
  165.   `idvac` tinyint(3) NOT NULL auto_increment,
  166.   `control` varchar(100) default NULL,
  167.   `descripcion` varchar(500) default NULL,
  168.   KEY `idvac` (`idvac`)
  169. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
  170.  
  171. /*Data for the table `sanidad_control` */
  172.  
  173. insert  into `sanidad_control`(`idvac`,`control`,`descripcion`) values (1,'TBC','TUBERCULOSIS'),(2,'Mastitis','para la mastitis');
  174.  
  175.  
  176. /*Table structure for table `vacunos` */
  177.  
  178. DROP TABLE IF EXISTS `vacunos`;
  179.  
  180. CREATE TABLE `vacunos` (
  181.   `codigo` int(10) NOT NULL,
  182.   `nombre` varchar(50) NOT NULL,
  183.   `nacimiento` date default NULL,
  184.   `sexo` varchar(50) default NULL,
  185.   `raza` tinyint(10) default NULL,
  186.   `peso` varchar(10) default NULL,
  187.   `madrecod` varchar(100) NOT NULL,
  188.   `padrecod` varchar(100) NOT NULL,
  189.   `foto` varchar(500) default NULL,
  190.   `pesoUND` varchar(10) default NULL,
  191.   PRIMARY KEY  (`codigo`),
  192.   KEY `codigo` (`codigo`),
  193.   KEY `raza` (`raza`)
  194. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  195.  
  196. /*Data for the table `vacunos` */
  197.  
  198. insert  into `vacunos`(`codigo`,`nombre`,`nacimiento`,`sexo`,`raza`,`peso`,`madrecod`,`padrecod`,`foto`,`pesoUND`) values (1,'X-11','2009-08-18','HEMBRA',1,'500','','','','KG'),(2,'X-14','2009-12-25','HEMBRA',1,'500','','','','KG'),(3,'X-13','2009-12-20','HEMBRA',1,'500','','','','KG'),(4,'186','2009-09-28','HEMBRA',1,'500','','','','KG'),(5,'214','2010-05-01','HEMBRA',1,'500','','','','KG'),(6,'204','2010-02-26','HEMBRA',1,'500','','','','KG'),(7,'182','2009-12-05','HEMBRA',1,'500','','','','KG');
  199.  
  200. /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  201. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  202. /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  203. /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement