initial commit
This commit is contained in:
191
doc/Informe/e1/Informe1.tex
Normal file
191
doc/Informe/e1/Informe1.tex
Normal file
@@ -0,0 +1,191 @@
|
||||
\documentclass[12pt]{article}
|
||||
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[spanish]{babel}
|
||||
\usepackage{array}
|
||||
\usepackage{adjustbox}
|
||||
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm,a4paper]{geometry}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{verbatim}
|
||||
\usepackage{courier}
|
||||
|
||||
\usepackage{listings}
|
||||
\usepackage{xcolor}
|
||||
|
||||
\lstdefinestyle{freefempp}{
|
||||
language=SQL,
|
||||
basicstyle=\footnotesize\ttfamily,
|
||||
commentstyle=\itshape\color{gray},
|
||||
keywordstyle=\color{blue},
|
||||
numberstyle=\color{red},
|
||||
stringstyle=\color{red},
|
||||
identifierstyle=\color{violet},
|
||||
showstringspaces=false,
|
||||
%float,
|
||||
%frame=single,
|
||||
%numbers=left
|
||||
}
|
||||
|
||||
\lstset{
|
||||
basicstyle=\footnotesize\ttfamily,
|
||||
columns=flexible,
|
||||
breaklines=true,
|
||||
style=freefempp
|
||||
}
|
||||
|
||||
\usepackage{titling}
|
||||
\renewcommand\maketitlehooka{\null\mbox{}\vfill}
|
||||
\renewcommand\maketitlehookd{\vfill\null}
|
||||
|
||||
\usepackage{hyperref}
|
||||
\hypersetup{colorlinks=true,allcolors=black}
|
||||
\usepackage{hypcap}
|
||||
|
||||
\title{\textbf{Proyecto Semestral de Base de Datos\\Entrega 1}}
|
||||
\author{Christopher Cromer\\\\Profesoras Mónica Caniupán y Valeria Beratto\\Ingeniería Civil Informática}
|
||||
\date{\today}
|
||||
|
||||
\pretitle{%
|
||||
\begin{center}
|
||||
\LARGE
|
||||
\includegraphics[width=4cm]{ubblogo.png}\\[\bigskipamount]
|
||||
}
|
||||
|
||||
\posttitle{\end{center}}
|
||||
|
||||
\begin{document}
|
||||
\clearpage
|
||||
\hypersetup{pageanchor=false}
|
||||
\begin{titlingpage}
|
||||
\maketitle
|
||||
\end{titlingpage}
|
||||
\thispagestyle{empty}
|
||||
|
||||
\newpage
|
||||
|
||||
\clearpage
|
||||
\thispagestyle{empty}
|
||||
\tableofcontents
|
||||
|
||||
\newpage
|
||||
\hypersetup{pageanchor=true}
|
||||
\pagenumbering{arabic}
|
||||
\section{Introducción}
|
||||
El objetivo de este trabajo es modelar un sistema para los colegios municipales de la región del Bío-Bío con el propósito de almacenar y consultar en una base de datos de PostgreSQL con información el colegio.
|
||||
|
||||
\newpage
|
||||
\section{Modelo Entidad Relación}
|
||||
\begin{center}
|
||||
\includegraphics[angle=270,origin=c,width=0.90\textwidth,height=0.90\textheight,keepaspectratio]{MER.png}
|
||||
\end{center}
|
||||
|
||||
\newpage
|
||||
\section{Modelo Relacional}
|
||||
\begin{center}
|
||||
En negrita se presentan las claves foráneas y las primarias en subrayado.\smallskip
|
||||
\end{center}
|
||||
region(\underline{id\_region}, nombre)\bigskip
|
||||
|
||||
\noindent
|
||||
ciudad(\underline{id\_ciudad}, nombre, \textbf{id\_region})\bigskip
|
||||
|
||||
\noindent
|
||||
apoderado(\underline{rut\_apoderado}, nombres, apellidos, direccion, \textbf{id\_ciudad})\bigskip
|
||||
|
||||
\noindent
|
||||
alumno(\underline{rut\_alumno}, nombres, apellidos, direccion, \textbf{id\_ciudad}, anyo\_ingreso, fecha\_nacimiento, \textbf{rut\_apoderado})\bigskip
|
||||
|
||||
\noindent
|
||||
profesor(\underline{rut\_profesor}, nombres, apellidos, direccion, \textbf{id\_ciudad})\bigskip
|
||||
|
||||
\noindent
|
||||
actividad(\underline{id\_actividad}, nombre, cupos, lugar, \textbf{rut\_profesor})\bigskip
|
||||
|
||||
\noindent
|
||||
nivel(\underline{id\_nivel}, nombre)\bigskip
|
||||
|
||||
\noindent
|
||||
bloque(\underline{id\_bloque}, descripcion)\bigskip
|
||||
|
||||
\noindent
|
||||
curso(\underline{id\_curso}, \textbf{rut\_profesor})\bigskip
|
||||
|
||||
\noindent
|
||||
asignatura(\underline{id\_asignatura}, nombre, \textbf{rut\_profesor})\bigskip
|
||||
|
||||
\noindent
|
||||
participar(\textbf{\underline{rut\_alumno}}, \textbf{\underline{id\_actividad}})\bigskip
|
||||
|
||||
\noindent
|
||||
actividad\_nivel(\textbf{\underline{id\_actividad}}, \textbf{\underline{id\_nivel}})\bigskip
|
||||
|
||||
\noindent
|
||||
actividad\_bloque(\textbf{\underline{id\_actividad}}, \textbf{\underline{id\_bloque}})\bigskip
|
||||
|
||||
\noindent
|
||||
horario(\textbf{\underline{id\_asignatura}}, \textbf{\underline{id\_bloque}}, sala)\bigskip
|
||||
|
||||
\noindent
|
||||
registro(\textbf{\underline{rut\_alumno}}, \textbf{\underline{id\_asignatura}}, nota)\bigskip
|
||||
|
||||
\noindent
|
||||
cursar(\textbf{\underline{rut\_alumno}}, \textbf{\underline{id\_curso}})\bigskip
|
||||
|
||||
\noindent
|
||||
asociado(\textbf{\underline{id\_curso}}, \textbf{\underline{id\_asignatura}})\bigskip
|
||||
|
||||
\noindent
|
||||
asistente(\textbf{\underline{rut\_profesor}}, \textbf{\underline{id\_curso}})\bigskip
|
||||
|
||||
\newpage
|
||||
\section{Justificación de Modelo Relacional}
|
||||
|
||||
\textbf{\textit{region}} no adquiere ninguna clave foránea debido a que las relaciones entre las otras entidades son de \textbf{\textit{1 a n}}.\bigskip
|
||||
|
||||
\textbf{\textit{ciudad}} adquiere la clave foránea \textbf{\textit{id\_region}} debido a que la relación entre las entidades \textbf{\textit{ciudad}} y \textbf{\textit{region}} es de \textbf{\textit{n a 1}}.\bigskip
|
||||
|
||||
\textbf{\textit{apoderado}} adquiere la clave foránea \textbf{\textit{id\_ciudad}} debido a que la relación entre las entidades \textbf{\textit{apoderado}} y \textbf{\textit{ciudad}} es de \textbf{\textit{n a 1}}.\bigskip
|
||||
|
||||
\textbf{\textit{alumno}} adquiere la clave foránea \textbf{\textit{id\_ciudad}} debido a que la relación entre las entidades \textbf{\textit{alumno}} y \textbf{\textit{ciudad}} es de \textbf{\textit{n a 1}}. También recibe la clave foránea \textbf{rut\_apoderado} debido a la relación entre las entidades \textbf{alumno} y \textbf{apoderado} que es de \textbf{n a 1}.\bigskip
|
||||
|
||||
\textbf{\textit{profesor}} adquiere la clave foránea \textbf{\textit{id\_ciudad}} debido a que la relación entre las entidades \textbf{\textit{profesor}} y \textbf{\textit{ciudad}} es de \textbf{\textit{n a 1}}.\bigskip
|
||||
|
||||
\textbf{\textit{actividad}} adquiere la clave foránea \textbf{\textit{rut\_profesor}} debido a que las relaciones entre las otras entidades \textbf{\textit{actividad}} y \textbf{\textit{profesor}} es de \textbf{\textit{1 a n}}.\bigskip
|
||||
|
||||
\textbf{\textit{nivel}} no adquiere ninguna clave foránea debido a que las relaciones entre las otras entidades son de \textbf{\textit{1 a n}}.\bigskip
|
||||
|
||||
\textbf{\textit{bloque}} no adquiere ninguna clave foránea debido a que las relaciones entre las otras entidades son de \textbf{\textit{1 a n}}.\bigskip
|
||||
|
||||
\textbf{\textit{curso}} adquiere la clave foránea \textbf{\textit{rut}} debido a que las relaciones entre las entidades \textbf{\textit{curso}} y \textbf{\textit{profesor}} es de \textbf{\textit{n a 1}}.\bigskip
|
||||
|
||||
\textbf{\textit{asignatura}} adquiere la clave foránea \textbf{\textit{rut\_profesor}} debido a que la relación entre las entidades \textbf{\textit{asignatura}} y \textbf{\textit{profesor}} es de \textbf{\textit{n a 1}}.\bigskip
|
||||
|
||||
\textbf{\textit{participar}} es creado con las claves foráneas \textbf{\textit{rut\_alumno}} y \textbf{\textit{id\_actividad}} dado que la relación entre \textbf{\textit{alumno}} y \textbf{\textit{actividad}} es de \textbf{\textit{n a n}}.\bigskip
|
||||
|
||||
\textbf{\textit{actividad\_nivel}} es creado con las claves foráneas \textbf{\textit{id\_actividad}} y \textbf{\textit{id\_nivel}} dado que la relación entre \textbf{\textit{actividad}} y \textbf{\textit{nivel}} es de \textbf{\textit{n a n}}.\bigskip
|
||||
|
||||
\textbf{\textit{actividad\_bloque}} es creado con las claves foráneas \textbf{\textit{id\_actividad}} y \textbf{\textit{id\_bloque}} dado que la relación entre \textbf{\textit{actividad}} y \textbf{\textit{bloque}} es de \textbf{\textit{n a n}}.\bigskip
|
||||
|
||||
\textbf{\textit{horario}} es creado con las claves foráneas \textbf{\textit{id\_asignatura}} y \textbf{\textit{id\_bloque}}, y queda con el atributo \textbf{\textit{sala}} dado que la relación entre \textbf{\textit{asignatura}} y \textbf{\textit{bloque}} es de \textbf{\textit{n a n}}.\bigskip
|
||||
|
||||
\textbf{\textit{registro}} es creado con las claves foráneas \textbf{\textit{rut\_alumno}} y \textbf{\textit{id\_asignatura}}, y queda con el atributo \textbf{\textit{nota}} dado que la relación entre \textbf{\textit{alumno}} y \textbf{\textit{asignatura}} es de \textbf{\textit{n a n}}.\bigskip
|
||||
|
||||
\textbf{\textit{cursar}} es creado con las claves foráneas \textbf{\textit{rut\_alumno}} y \textbf{\textit{id\_curso}} dado que la relación entre \textbf{\textit{alumno}} y \textbf{\textit{curso}} es de \textbf{\textit{n a n}}.\bigskip
|
||||
|
||||
\textbf{\textit{asociado}} es creado con las claves foráneas \textbf{\textit{id\_curso}} y \textbf{\textit{id\_asignatura}} dado que la relación entre \textbf{\textit{curso}} y \textbf{\textit{asignatura}} es de \textbf{\textit{n a n}}.\bigskip
|
||||
|
||||
\textbf{\textit{asistente}} es creado opcionalmente con las claves foráneas \textbf{\textit{rut\_profesor}} y \textbf{\textit{id\_curso}} dado que la relación entre \textbf{\textit{curso}} y \textbf{\textit{profesor}} es de \textbf{\textit{n a 1 con mínimo de 0}}.\bigskip
|
||||
|
||||
\newpage
|
||||
\section{Script SQL}
|
||||
|
||||
\subsection{Crear tablas}
|
||||
|
||||
\lstinputlisting{crear_tablas.sql}
|
||||
|
||||
\newpage
|
||||
\subsection{Insertar duplas}
|
||||
|
||||
\lstinputlisting{insertar_duplas.sql}
|
||||
|
||||
\end{document}
|
BIN
doc/Informe/e1/MER.dia
Normal file
BIN
doc/Informe/e1/MER.dia
Normal file
Binary file not shown.
BIN
doc/Informe/e1/MER.png
Normal file
BIN
doc/Informe/e1/MER.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 54 KiB |
150
doc/Informe/e1/crear_tablas.sql
Normal file
150
doc/Informe/e1/crear_tablas.sql
Normal file
@@ -0,0 +1,150 @@
|
||||
CREATE TABLE region(
|
||||
id_region SMALLSERIAL UNIQUE,
|
||||
nombre_region VARCHAR(20) NOT NULL,
|
||||
PRIMARY KEY (id_region)
|
||||
);
|
||||
|
||||
CREATE TABLE ciudad(
|
||||
id_ciudad SMALLSERIAL UNIQUE,
|
||||
nombre_ciudad VARCHAR(20) NOT NULL,
|
||||
id_region SMALLINT,
|
||||
PRIMARY KEY (id_ciudad),
|
||||
FOREIGN KEY (id_region) REFERENCES region (id_region) ON DELETE RESTRICT
|
||||
);
|
||||
|
||||
CREATE TABLE apoderado(
|
||||
rut_apoderado VARCHAR(9) NOT NULL UNIQUE CHECK (rut_apoderado ~ '^[0-9k]+$'),
|
||||
nombres VARCHAR(50) NOT NULL,
|
||||
apellidos VARCHAR(50) NOT NULL,
|
||||
direccion VARCHAR(30) NOT NULL,
|
||||
id_ciudad SMALLINT,
|
||||
PRIMARY KEY (rut_apoderado),
|
||||
FOREIGN KEY (id_ciudad) REFERENCES ciudad (id_ciudad) ON DELETE RESTRICT
|
||||
);
|
||||
|
||||
CREATE TABLE alumno(
|
||||
rut_alumno VARCHAR(9) NOT NULL UNIQUE CHECK (rut_alumno ~ '^[0-9k]+$'),
|
||||
nombres VARCHAR(50) NOT NULL,
|
||||
apellidos VARCHAR(50) NOT NULL,
|
||||
direccion VARCHAR(30) NOT NULL,
|
||||
id_ciudad SMALLINT,
|
||||
anyo_ingreso SMALLINT CHECK (anyo_ingreso > 1980),
|
||||
fecha_nacimiento DATE NOT NULL CHECK (fecha_nacimiento > '1980-01-01'),
|
||||
rut_apoderado VARCHAR(9) NOT NULL CHECK (rut_apoderado ~ '^[0-9k]+$'),
|
||||
PRIMARY KEY (rut_alumno),
|
||||
FOREIGN KEY (id_ciudad) REFERENCES ciudad (id_ciudad) ON DELETE RESTRICT,
|
||||
FOREIGN KEY (rut_apoderado) REFERENCES apoderado (rut_apoderado) ON DELETE RESTRICT
|
||||
);
|
||||
|
||||
CREATE TABLE profesor(
|
||||
rut_profesor VARCHAR(9) NOT NULL UNIQUE CHECK (rut_profesor ~ '^[0-9k]+$'),
|
||||
nombres VARCHAR(50) NOT NULL,
|
||||
apellidos VARCHAR(50) NOT NULL,
|
||||
direccion VARCHAR(30) NOT NULL,
|
||||
id_ciudad SMALLINT,
|
||||
PRIMARY KEY (rut_profesor),
|
||||
FOREIGN KEY (id_ciudad) REFERENCES ciudad (id_ciudad) ON DELETE RESTRICT
|
||||
);
|
||||
|
||||
CREATE TABLE actividad(
|
||||
id_actividad SERIAL UNIQUE,
|
||||
nombre VARCHAR(50) NOT NULL,
|
||||
cupos SMALLINT CHECK (cupos > 0),
|
||||
lugar VARCHAR(20) NOT NULL,
|
||||
rut_profesor VARCHAR(9) NOT NULL UNIQUE CHECK (rut_profesor ~ '^[0-9k]+$'),
|
||||
PRIMARY KEY (id_actividad),
|
||||
FOREIGN KEY (rut_profesor) REFERENCES profesor (rut_profesor) ON DELETE RESTRICT
|
||||
);
|
||||
|
||||
CREATE TABLE nivel(
|
||||
id_nivel SERIAL UNIQUE,
|
||||
nombre VARCHAR(20) NOT NULL,
|
||||
PRIMARY KEY (id_nivel)
|
||||
);
|
||||
|
||||
CREATE TABLE bloque(
|
||||
id_bloque SERIAL UNIQUE,
|
||||
descripcion VARCHAR(20) NOT NULL,
|
||||
PRIMARY KEY (id_bloque)
|
||||
);
|
||||
|
||||
CREATE TABLE curso(
|
||||
id_curso VARCHAR(10) NOT NULL UNIQUE,
|
||||
rut_profesor VARCHAR(9) NOT NULL CHECK (rut_profesor ~ '^[0-9k]+$'),
|
||||
PRIMARY KEY (id_curso),
|
||||
FOREIGN KEY (rut_profesor) REFERENCES profesor (rut_profesor) ON DELETE RESTRICT
|
||||
);
|
||||
|
||||
CREATE TABLE asignatura(
|
||||
id_asignatura SERIAL UNIQUE,
|
||||
nombre VARCHAR(50) NOT NULL,
|
||||
rut_profesor VARCHAR(9) NOT NULL CHECK (rut_profesor ~ '^[0-9k]+$'),
|
||||
PRIMARY KEY (id_asignatura),
|
||||
FOREIGN KEY (rut_profesor) REFERENCES profesor (rut_profesor) ON DELETE RESTRICT
|
||||
);
|
||||
|
||||
CREATE TABLE participar(
|
||||
rut_alumno VARCHAR(9) NOT NULL CHECK (rut_alumno ~ '^[0-9k]+$'),
|
||||
id_actividad INT,
|
||||
PRIMARY KEY (rut_alumno, id_actividad),
|
||||
FOREIGN KEY (rut_alumno) REFERENCES alumno (rut_alumno) ON DELETE RESTRICT,
|
||||
FOREIGN KEY (id_actividad) REFERENCES actividad (id_actividad) ON DELETE RESTRICT
|
||||
);
|
||||
|
||||
CREATE TABLE actividad_nivel(
|
||||
id_actividad INT,
|
||||
id_nivel INT,
|
||||
PRIMARY KEY (id_actividad, id_nivel),
|
||||
FOREIGN KEY (id_actividad) REFERENCES actividad (id_actividad) ON DELETE RESTRICT,
|
||||
FOREIGN KEY (id_nivel) REFERENCES nivel (id_nivel) ON DELETE RESTRICT
|
||||
);
|
||||
|
||||
CREATE TABLE actividad_bloque(
|
||||
id_actividad INT,
|
||||
id_bloque INT,
|
||||
PRIMARY KEY (id_actividad, id_bloque),
|
||||
FOREIGN KEY (id_actividad) REFERENCES actividad (id_actividad) ON DELETE RESTRICT,
|
||||
FOREIGN KEY (id_bloque) REFERENCES bloque (id_bloque) ON DELETE RESTRICT
|
||||
);
|
||||
|
||||
CREATE TABLE horario(
|
||||
id_asignatura INT,
|
||||
id_bloque INT,
|
||||
sala VARCHAR(20) NOT NULL,
|
||||
PRIMARY KEY (id_asignatura, id_bloque),
|
||||
FOREIGN KEY (id_asignatura) REFERENCES asignatura (id_asignatura) ON DELETE RESTRICT,
|
||||
FOREIGN KEY (id_bloque) REFERENCES bloque (id_bloque) ON DELETE RESTRICT
|
||||
);
|
||||
|
||||
CREATE TABLE registro(
|
||||
rut_alumno VARCHAR(9) NOT NULL CHECK (rut_alumno ~ '^[0-9k]+$'),
|
||||
id_asignatura INT,
|
||||
nota NUMERIC(2,1) CHECK (nota >= 1.0 AND nota <= 7.0),
|
||||
PRIMARY KEY (rut_alumno, id_asignatura),
|
||||
FOREIGN KEY (rut_alumno) REFERENCES alumno (rut_alumno) ON DELETE RESTRICT,
|
||||
FOREIGN KEY (id_asignatura) REFERENCES asignatura (id_asignatura) ON DELETE RESTRICT
|
||||
);
|
||||
|
||||
CREATE TABLE cursar(
|
||||
rut_alumno VARCHAR(9) NOT NULL CHECK (rut_alumno ~ '^[0-9k]+$'),
|
||||
id_curso VARCHAR(10) NOT NULL,
|
||||
PRIMARY KEY (rut_alumno, id_curso),
|
||||
FOREIGN KEY (rut_alumno) REFERENCES alumno (rut_alumno) ON DELETE RESTRICT,
|
||||
FOREIGN KEY (id_curso) REFERENCES curso (id_curso) ON DELETE RESTRICT
|
||||
);
|
||||
|
||||
CREATE TABLE asociado(
|
||||
id_curso VARCHAR(10) NOT NULL,
|
||||
id_asignatura INT,
|
||||
PRIMARY KEY (id_curso, id_asignatura),
|
||||
FOREIGN KEY (id_curso) REFERENCES curso (id_curso) ON DELETE RESTRICT,
|
||||
FOREIGN KEY (id_asignatura) REFERENCES asignatura (id_asignatura) ON DELETE RESTRICT
|
||||
);
|
||||
|
||||
CREATE TABLE asistente(
|
||||
rut_profesor VARCHAR(9) NOT NULL CHECK (rut_profesor ~ '^[0-9k]+$'),
|
||||
id_curso VARCHAR(10) NOT NULL,
|
||||
PRIMARY KEY (rut_profesor, id_curso),
|
||||
FOREIGN KEY (rut_profesor) REFERENCES profesor (rut_profesor) ON DELETE RESTRICT,
|
||||
FOREIGN KEY (id_curso) REFERENCES curso (id_curso) ON DELETE RESTRICT
|
||||
);
|
71
doc/Informe/e1/insertar_duplas.sql
Normal file
71
doc/Informe/e1/insertar_duplas.sql
Normal file
@@ -0,0 +1,71 @@
|
||||
INSERT INTO region (id_region, nombre_region) VALUES (1, 'Florida');
|
||||
INSERT INTO region (id_region, nombre_region) VALUES (2, 'Alabama');
|
||||
INSERT INTO region (id_region, nombre_region) VALUES (3, 'Virginia');
|
||||
|
||||
INSERT INTO ciudad (id_ciudad, nombre_ciudad, id_region) VALUES (1, 'Pensacola', 1);
|
||||
INSERT INTO ciudad (id_ciudad, nombre_ciudad, id_region) VALUES (2, 'Montgomery', 2);
|
||||
INSERT INTO ciudad (id_ciudad, nombre_ciudad, id_region) VALUES (3, 'Virginia Beach', 3);
|
||||
|
||||
INSERT INTO apoderado (rut_apoderado, nombres, apellidos, direccion, id_ciudad) VALUES ('14592927k', 'Christopher Barry', 'Cromer', '214 Edison Dr.', 1);
|
||||
INSERT INTO apoderado (rut_apoderado, nombres, apellidos, direccion, id_ciudad) VALUES ('192186099', 'Elia Alejandra', 'Chacano Troncoso', 'Avenida San Sebastian 778', 2);
|
||||
INSERT INTO apoderado (rut_apoderado, nombres, apellidos, direccion, id_ciudad) VALUES ('192199859', 'Jack', 'Johnson', '320 Thomas Jefferson St.', 3);
|
||||
|
||||
INSERT INTO alumno (rut_alumno, nombres, apellidos, direccion, anyo_ingreso, fecha_nacimiento, rut_apoderado, id_ciudad) VALUES ('254049492', 'Izabella Lynn', 'Cromer Chacano', '214 Edison Dr.', 2019, '2019-10-04', '14592927k', 1);
|
||||
INSERT INTO alumno (rut_alumno, nombres, apellidos, direccion, anyo_ingreso, fecha_nacimiento, rut_apoderado, id_ciudad) VALUES ('245191391', 'Tomas', 'Bunt', 'Avenida San Sebastian 778', 2018, '2010-02-05', '192186099', 2);
|
||||
INSERT INTO alumno (rut_alumno, nombres, apellidos, direccion, anyo_ingreso, fecha_nacimiento, rut_apoderado, id_ciudad) VALUES ('18028642k', 'Tom', 'Riddle', '320 Thomas Jefferson St.', 2017, '2014-12-31', '192199859', 3);
|
||||
|
||||
INSERT INTO profesor (rut_profesor, nombres, apellidos, direccion, id_ciudad) VALUES ('226174788', 'Severus', 'Snape', '232 Jackson Ave.', 1);
|
||||
INSERT INTO profesor (rut_profesor, nombres, apellidos, direccion, id_ciudad) VALUES ('226779329', 'Minerva', 'McGonagall', '333 Nottingham Ln.', 2);
|
||||
INSERT INTO profesor (rut_profesor, nombres, apellidos, direccion, id_ciudad) VALUES ('139414853', 'Albus', 'Dumbledore', '8450 Sparrow Rd.', 3);
|
||||
|
||||
INSERT INTO actividad (id_actividad, nombre, cupos, lugar, rut_profesor) VALUES (1, 'Quidditch', 14, 'Quidditch field', '226174788');
|
||||
INSERT INTO actividad (id_actividad, nombre, cupos, lugar, rut_profesor) VALUES (2, 'Ogre taming', 5, 'The forbidden forest', '226779329');
|
||||
INSERT INTO actividad (id_actividad, nombre, cupos, lugar, rut_profesor) VALUES (3, 'Advanced transfiguration', 2, 'Headmaster''s office', '139414853');
|
||||
|
||||
INSERT INTO nivel (id_nivel, nombre) VALUES (1, 'First');
|
||||
INSERT INTO nivel (id_nivel, nombre) VALUES (2, 'Second');
|
||||
INSERT INTO nivel (id_nivel, nombre) VALUES (3, 'Third');
|
||||
|
||||
INSERT INTO bloque (id_bloque, descripcion) VALUES (1, '08:10 - 09:30');
|
||||
INSERT INTO bloque (id_bloque, descripcion) VALUES (2, '09:40 - 11:00');
|
||||
INSERT INTO bloque (id_bloque, descripcion) VALUES (3, '11:10 - 12:30');
|
||||
|
||||
INSERT INTO curso (id_curso, rut_profesor) VALUES ('1A-2017', '226174788');
|
||||
INSERT INTO curso (id_curso, rut_profesor) VALUES ('2B-2018', '226779329');
|
||||
INSERT INTO curso (id_curso, rut_profesor) VALUES ('3C-2019', '139414853');
|
||||
|
||||
INSERT INTO asignatura (id_asignatura, nombre, rut_profesor) VALUES (1, 'Transfiguration', '226779329');
|
||||
INSERT INTO asignatura (id_asignatura, nombre, rut_profesor) VALUES (2, 'Defense against the dark arts', '226174788');
|
||||
INSERT INTO asignatura (id_asignatura, nombre, rut_profesor) VALUES (3, 'Muggle studies', '139414853');
|
||||
|
||||
INSERT INTO participar (rut_alumno, id_actividad) VALUES ('254049492', 1);
|
||||
INSERT INTO participar (rut_alumno, id_actividad) VALUES ('245191391', 2);
|
||||
INSERT INTO participar (rut_alumno, id_actividad) VALUES ('18028642k', 3);
|
||||
|
||||
INSERT INTO actividad_nivel (id_actividad, id_nivel) VALUES (1, 1);
|
||||
INSERT INTO actividad_nivel (id_actividad, id_nivel) VALUES (2, 2);
|
||||
INSERT INTO actividad_nivel (id_actividad, id_nivel) VALUES (3, 3);
|
||||
|
||||
INSERT INTO actividad_bloque (id_actividad, id_bloque) VALUES (1, 1);
|
||||
INSERT INTO actividad_bloque (id_actividad, id_bloque) VALUES (2, 2);
|
||||
INSERT INTO actividad_bloque (id_actividad, id_bloque) VALUES (3, 3);
|
||||
|
||||
INSERT INTO horario (id_asignatura, id_bloque, sala) VALUES (1, 1, '203AC');
|
||||
INSERT INTO horario (id_asignatura, id_bloque, sala) VALUES (2, 2, '301AB');
|
||||
INSERT INTO horario (id_asignatura, id_bloque, sala) VALUES (3, 3, '102AA');
|
||||
|
||||
INSERT INTO registro (rut_alumno, id_asignatura, nota) VALUES ('254049492', 1, 7.0);
|
||||
INSERT INTO registro (rut_alumno, id_asignatura, nota) VALUES ('245191391', 2, 4.0);
|
||||
INSERT INTO registro (rut_alumno, id_asignatura, nota) VALUES ('18028642k', 3, 1.0);
|
||||
|
||||
INSERT INTO cursar (rut_alumno, id_curso) VALUES ('254049492', '1A-2017');
|
||||
INSERT INTO cursar (rut_alumno, id_curso) VALUES ('245191391', '2B-2018');
|
||||
INSERT INTO cursar (rut_alumno, id_curso) VALUES ('18028642k', '3C-2019');
|
||||
|
||||
INSERT INTO asociado (id_curso, id_asignatura) VALUES ('1A-2017', 1);
|
||||
INSERT INTO asociado (id_curso, id_asignatura) VALUES ('2B-2018', 2);
|
||||
INSERT INTO asociado (id_curso, id_asignatura) VALUES ('3C-2019', 3);
|
||||
|
||||
INSERT INTO asistente (rut_profesor, id_curso) VALUES ('139414853', '1A-2017');
|
||||
INSERT INTO asistente (rut_profesor, id_curso) VALUES ('226174788', '2B-2018');
|
||||
INSERT INTO asistente (rut_profesor, id_curso) VALUES ('226779329', '3C-2019');
|
BIN
doc/Informe/e1/ubblogo.png
Normal file
BIN
doc/Informe/e1/ubblogo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 185 KiB |
Reference in New Issue
Block a user