· 8 years ago · Nov 26, 2017, 03:44 PM
1-- MySQL dump 10.12
2--
3-- Host: localhost Database: colegio
4-- ------------------------------------------------------
5-- Server version 6.0.0-alpha-community-nt-debug
6
7/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10/*!40101 SET NAMES utf8 */;
11/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12/*!40103 SET TIME_ZONE='+00:00' */;
13/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17
18--
19-- Table structure for table `cursos`
20--
21
22DROP TABLE IF EXISTS `cursos`;
23CREATE TABLE `cursos` (
24 `idcurso` varchar(4) NOT NULL DEFAULT '',
25 `nombrecurso` text,
26 PRIMARY KEY (`idcurso`)
27) ENGINE=InnoDB DEFAULT CHARSET=latin1;
28
29--
30-- Dumping data for table `cursos`
31--
32
33LOCK TABLES `cursos` WRITE;
34/*!40000 ALTER TABLE `cursos` DISABLE KEYS */;
35INSERT INTO `cursos` VALUES ('C111','Algebra'),('C333','Espa¤ol'),('C999','Sociales');
36/*!40000 ALTER TABLE `cursos` ENABLE KEYS */;
37UNLOCK TABLES;
38
39--
40-- Table structure for table `estudiantes`
41--
42
43DROP TABLE IF EXISTS `estudiantes`;
44CREATE TABLE `estudiantes` (
45 `numerocarnet` int(11) NOT NULL DEFAULT '0',
46 `nombre` text,
47 `barrio` text,
48 PRIMARY KEY (`numerocarnet`)
49) ENGINE=InnoDB DEFAULT CHARSET=latin1;
50
51--
52-- Dumping data for table `estudiantes`
53--
54
55LOCK TABLES `estudiantes` WRITE;
56/*!40000 ALTER TABLE `estudiantes` DISABLE KEYS */;
57INSERT INTO `estudiantes` VALUES (1,'ana','el poblado'),(2,'Leo','manrique'),(3,'Maria','el poblado'),(4,'Mario','Robledo'),(5,'Pepe','el poblado'),(6,'Stiven','manrique'),(7,'Leon','Buenos Aires'),(8,'Camilo','el poblado'),(9,'Cecilia','el poblado'),(10,'Amanda','Castilla'),(11,'Camila','San Javier'),(12,'Lina','Buenos Aires'),(13,'Andres','el poblado'),(14,'Kevin','Popular'),(15,'Luis','el poblado'),(16,'Pedro','Doce de octubre'),(17,'Annie','Estadio'),(18,'Linda','Manrique');
58/*!40000 ALTER TABLE `estudiantes` ENABLE KEYS */;
59UNLOCK TABLES;
60
61--
62-- Table structure for table `notas`
63--
64
65DROP TABLE IF EXISTS `notas`;
66CREATE TABLE `notas` (
67 `idcurso` varchar(4) NOT NULL DEFAULT '',
68 `numerocarnet` int(11) NOT NULL DEFAULT '0',
69 `cedulaprofesor` varchar(10) NOT NULL DEFAULT '',
70 `fecha` date NOT NULL DEFAULT '0000-00-00',
71 `valor` float DEFAULT NULL,
72 PRIMARY KEY (`idcurso`,`numerocarnet`,`cedulaprofesor`,`fecha`),
73 KEY `numerocarnet` (`numerocarnet`),
74 KEY `cedulaprofesor` (`cedulaprofesor`),
75 CONSTRAINT `notas_ibfk_1` FOREIGN KEY (`idcurso`) REFERENCES `cursos` (`idcurso`) ON DELETE CASCADE ON UPDATE CASCADE,
76 CONSTRAINT `notas_ibfk_2` FOREIGN KEY (`numerocarnet`) REFERENCES `estudiantes` (`numerocarnet`) ON DELETE CASCADE ON UPDATE CASCADE,
77 CONSTRAINT `notas_ibfk_3` FOREIGN KEY (`cedulaprofesor`) REFERENCES `profesores` (`cedula`) ON DELETE CASCADE ON UPDATE CASCADE
78) ENGINE=InnoDB DEFAULT CHARSET=latin1;
79
80--
81-- Dumping data for table `notas`
82--
83
84LOCK TABLES `notas` WRITE;
85/*!40000 ALTER TABLE `notas` DISABLE KEYS */;
86INSERT INTO `notas` VALUES ('C999',6,'333','2017-11-26',3.5),('C999',13,'333','2017-11-26',4.9),('C999',15,'333','2017-11-26',2.2),('C999',16,'333','2017-11-26',4.5),('C999',18,'333','2017-11-26',4.1);
87/*!40000 ALTER TABLE `notas` ENABLE KEYS */;
88UNLOCK TABLES;
89
90--
91-- Table structure for table `profesores`
92--
93
94DROP TABLE IF EXISTS `profesores`;
95CREATE TABLE `profesores` (
96 `cedula` varchar(10) NOT NULL DEFAULT '',
97 `nombre` text,
98 PRIMARY KEY (`cedula`)
99) ENGINE=InnoDB DEFAULT CHARSET=latin1;
100
101--
102-- Dumping data for table `profesores`
103--
104
105LOCK TABLES `profesores` WRITE;
106/*!40000 ALTER TABLE `profesores` DISABLE KEYS */;
107INSERT INTO `profesores` VALUES ('111','Eddie'),('333','Alfredo'),('999','Ricardo');
108/*!40000 ALTER TABLE `profesores` ENABLE KEYS */;
109UNLOCK TABLES;
110/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
111
112/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
113/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
114/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
115/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
116/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
117/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
118/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
119
120-- Dump completed on 2017-11-26 15:41:48