Mysql-evaluacion-encuesta
tipomalo30 de Agosto de 2011
483 Palabras (2 Páginas)1.429 Visitas
/*
Created 29/08/2011
Modified 30/08/2011
Project
Model
Company
Author
Version
Database mySQL 5
*/
Create table tabla_docente (
id_maestro Int NOT NULL,
id_curso Int NOT NULL,
nombre Varchar(20) NOT NULL,
apellido Varchar(30) NOT NULL,
fecha_ngreso Datetime,
Primary Key (id_maestro,id_curso)) ENGINE = MyISAM;
Create table tabla_curso (
id_curso Int NOT NULL,
nombre_curso Varchar(30) NOT NULL,
fecha_inicio Datetime NOT NULL,
fecha_fin Datetime NOT NULL,
duracion Varchar(15) NOT NULL,
Primary Key (id_curso)) ENGINE = MyISAM;
Create table tabla_alumno (
id_alumno Int NOT NULL,
id_curso Int NOT NULL,
nombre Varchar(15) NOT NULL,
apellido Varchar(30) NOT NULL,
Primary Key (id_alumno,id_curso)) ENGINE = MyISAM;
Create table preguntas_docente (
id_D Int NOT NULL,
id_cat Int NOT NULL,
pregunta Varchar(120) NOT NULL,
Primary Key (id_D,id_cat)) ENGINE = MyISAM;
Create table preguntas_administrativos (
id_Admi Int NOT NULL,
id_cat Int NOT NULL,
pregunta Varchar(120) NOT NULL,
Primary Key (id_Admi,id_cat)) ENGINE = MyISAM;
Create table preguntas_institucion (
id_I Int NOT NULL,
id_cat Int NOT NULL,
pregunta Varchar(120) NOT NULL,
Primary Key (id_I,id_cat)) ENGINE = MyISAM;
Create table preguntas_mantenimiento (
id_M Int NOT NULL,
id_cat Int NOT NULL,
pregunta Varchar(120) NOT NULL,
Primary Key (id_M,id_cat)) ENGINE = MyISAM;
Create table categoria_pregunta (
id_cat Int NOT NULL,
descripcion Varchar(20),
Primary Key (id_cat)) ENGINE = MyISAM;
Create table tabla_administrativos (
id_admin Int NOT NULL,
id_cat Int NOT NULL,
nombre Varchar(20) NOT NULL,
apellido Varchar(30) NOT NULL,
fecha_contrato Datetime NOT NULL,
Primary Key (id_admin)) ENGINE = MyISAM;
Create table tabla_mantenimiento (
id_persona Int NOT NULL,
id_cat Int NOT NULL,
nombre Varchar(15) NOT NULL,
apellido Varchar(30) NOT NULL,
fecha_contrato Datetime NOT NULL,
Primary Key (id_persona)) ENGINE = MyISAM;
Create table resultado_docente (
promedio Double NOT NULL,
id_maestro Int NOT NULL,
id_curso Int NOT NULL,
fecha_aplicacion Datetime NOT NULL) ENGINE = MyISAM;
Create table resultado_administrativos (
id_cat Int NOT NULL,
promedio Double NOT NULL,
fecha_aplicacion Datetime NOT NULL,
Primary Key (id_cat)) ENGINE = MyISAM;
Create table resultado_institucion (
promedio Double NOT NULL,
fecha_aplicacion Datetime NOT NULL,
id_cat Int NOT NULL,
Primary Key (id_cat)) ENGINE = MyISAM;
Create table resultado_mantenimiento (
id_cat Int NOT NULL,
promedio Double NOT NULL,
fecha_aplicacion Datetime NOT NULL,
Primary Key (id_cat)) ENGINE = MyISAM;
Alter table resultado_docente add Foreign Key (id_maestro,id_curso) references tabla_docente (id_maestro,id_curso) on delete restrict on update restrict;
Alter table tabla_docente add Foreign Key (id_curso) references tabla_curso (id_curso) on delete restrict on update restrict;
Alter table tabla_alumno add Foreign Key (id_curso) references tabla_curso (id_curso) on delete restrict on update restrict;
Alter
...