commit
23735a66de
55 changed files with 3311 additions and 0 deletions
@ -0,0 +1,10 @@ |
||||
build |
||||
*.tar.gz |
||||
*.autosave |
||||
*#*# |
||||
*.aux |
||||
*.log |
||||
*.toc |
||||
*.synctex.gz |
||||
*.out |
||||
*.pdf |
@ -0,0 +1,11 @@ |
||||
Copyright 2019 Chris Cromer |
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. |
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. |
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
@ -0,0 +1,28 @@ |
||||
# Colegio |
||||
Este proyecto es para conectar a un base de datos de Postgresql para el ramo de Base de Datos. |
||||
|
||||
## Profesora |
||||
Monica Mónica Caniupán & Valeria Beratto |
||||
|
||||
## Requisitos |
||||
- Vala |
||||
- Meson |
||||
- Ninja |
||||
- Gtk+-3 |
||||
- Libpq |
||||
- Valadoc (opcional para compilar valadoc del proyecto) |
||||
|
||||
## Compilar |
||||
meson --prefix=/usr build |
||||
cd build |
||||
ninja |
||||
|
||||
## Opciones de compilación |
||||
-D valadocs=true |
||||
Esta opción va a compilar la documentación de codiǵo fuente usando valadoc |
||||
|
||||
-D valadocs_dep=true |
||||
Si ambos valadocs y esta opción están en uso se va a compilar la documentación del proyecto y tambien la documentación de todos los dependencias. Esta opción es caro y hace mucho mas lento la compilación. |
||||
|
||||
-D debugging=true |
||||
Compilar con flags de depuración. Eso implica errores fatales que generan core dumps para ayudar con la depuración. |
@ -0,0 +1 @@ |
||||
subdir('ui') |
@ -0,0 +1,22 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
~ Copyright 2019 Chris Cromer |
||||
~ |
||||
~ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
||||
~ |
||||
~ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
||||
~ |
||||
~ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. |
||||
~ |
||||
~ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. |
||||
~ |
||||
~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
--> |
||||
<gresources> |
||||
<gresource prefix="/cl/cromer/ubb/colegio"> |
||||
<file preprocess="xml-stripblanks">main.window.ui</file> |
||||
<file preprocess="xml-stripblanks">main.splash.ui</file> |
||||
<file preprocess="to-pixdata">pixdata/icon-colegio.png</file> |
||||
<file preprocess="to-pixdata">pixdata/logo-colegio.png</file> |
||||
</gresource> |
||||
</gresources> |
@ -0,0 +1,55 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- Generated with glade 3.22.1 |
||||
|
||||
Copyright 2019 Chris Cromer |
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. |
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. |
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
--> |
||||
<interface domain="colegio"> |
||||
<requires lib="gtk+" version="3.20"/> |
||||
<object class="GtkGrid" id="content_grid"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">False</property> |
||||
<property name="margin_left">5</property> |
||||
<property name="margin_right">5</property> |
||||
<property name="margin_top">5</property> |
||||
<property name="margin_bottom">5</property> |
||||
<property name="column_homogeneous">True</property> |
||||
<child> |
||||
<object class="GtkImage"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">False</property> |
||||
<property name="halign">center</property> |
||||
<property name="valign">end</property> |
||||
<property name="resource">/cl/cromer/ubb/colegio/pixdata/logo-colegio.png</property> |
||||
</object> |
||||
<packing> |
||||
<property name="left_attach">0</property> |
||||
<property name="top_attach">0</property> |
||||
</packing> |
||||
</child> |
||||
<child> |
||||
<object class="GtkLabel"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">False</property> |
||||
<property name="halign">center</property> |
||||
<property name="valign">center</property> |
||||
<property name="label" translatable="yes">Christopher Cromer</property> |
||||
<property name="justify">center</property> |
||||
</object> |
||||
<packing> |
||||
<property name="left_attach">0</property> |
||||
<property name="top_attach">1</property> |
||||
</packing> |
||||
</child> |
||||
</object> |
||||
</interface> |
@ -0,0 +1,13 @@ |
||||
gnome = import('gnome') |
||||
main_gresource = gnome.compile_resources('main_gresource', |
||||
'main.gresource.xml', |
||||
source_dir: '.', |
||||
c_name: meson.project_name() + '_resource_main', |
||||
export: true, |
||||
install_header: true) |
||||
query_gresource = gnome.compile_resources('query_gresource', |
||||
'query.gresource.xml', |
||||
source_dir: '.', |
||||
c_name: meson.project_name() + '_resource_query', |
||||
export: true, |
||||
install_header: true) |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 366 KiB |
@ -0,0 +1,20 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
~ Copyright 2019 Chris Cromer |
||||
~ |
||||
~ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
||||
~ |
||||
~ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
||||
~ |
||||
~ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. |
||||
~ |
||||
~ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. |
||||
~ |
||||
~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
--> |
||||
<gresources> |
||||
<gresource prefix="/cl/cromer/ubb/colegio"> |
||||
<file preprocess="xml-stripblanks">query.window.ui</file> |
||||
<file preprocess="xml-stripblanks">query.tree.ui</file> |
||||
</gresource> |
||||
</gresources> |
@ -0,0 +1,284 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- Generated with glade 3.22.1 |
||||
|
||||
Copyright 2019 Chris Cromer |
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. |
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. |
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
--> |
||||
<interface domain="colegio"> |
||||
<requires lib="gtk+" version="3.20"/> |
||||
<object class="GtkListStore" id="liststore1"/> |
||||
<object class="GtkTreeView" id="query_tree_q1"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">True</property> |
||||
<property name="hexpand">True</property> |
||||
<property name="vexpand">True</property> |
||||
<property name="model">liststore1</property> |
||||
<property name="headers_clickable">False</property> |
||||
<property name="enable_search">False</property> |
||||
<property name="fixed_height_mode">True</property> |
||||
<property name="show_expanders">False</property> |
||||
<property name="enable_grid_lines">both</property> |
||||
<property name="enable_tree_lines">True</property> |
||||
<child internal-child="selection"> |
||||
<object class="GtkTreeSelection"> |
||||
<property name="mode">none</property> |
||||
</object> |
||||
</child> |
||||
<child> |
||||
<object class="GtkTreeViewColumn" id="alumno"> |
||||
<property name="sizing">fixed</property> |
||||
<property name="title" translatable="yes">Alumno</property> |
||||
<child> |
||||
<object class="GtkCellRendererText"/> |
||||
<attributes> |
||||
<attribute name="markup">0</attribute> |
||||
</attributes> |
||||
</child> |
||||
</object> |
||||
</child> |
||||
<child> |
||||
<object class="GtkTreeViewColumn" id="apoderado"> |
||||
<property name="sizing">fixed</property> |
||||
<property name="title" translatable="yes">Apoderado</property> |
||||
<child> |
||||
<object class="GtkCellRendererText"/> |
||||
<attributes> |
||||
<attribute name="markup">1</attribute> |
||||
</attributes> |
||||
</child> |
||||
</object> |
||||
</child> |
||||
<child> |
||||
<object class="GtkTreeViewColumn" id="curso_q1"> |
||||
<property name="sizing">fixed</property> |
||||
<property name="title" translatable="yes">Curso</property> |
||||
<child> |
||||
<object class="GtkCellRendererText"/> |
||||
<attributes> |
||||
<attribute name="markup">2</attribute> |
||||
</attributes> |
||||
</child> |
||||
</object> |
||||
</child> |
||||
<child> |
||||
<object class="GtkTreeViewColumn" id="jefe"> |
||||
<property name="sizing">fixed</property> |
||||
<property name="title" translatable="yes">Jefe</property> |
||||
<child> |
||||
<object class="GtkCellRendererText"/> |
||||
<attributes> |
||||
<attribute name="markup">3</attribute> |
||||
</attributes> |
||||
</child> |
||||
</object> |
||||
</child> |
||||
<child> |
||||
<object class="GtkTreeViewColumn" id="asistente"> |
||||
<property name="sizing">fixed</property> |
||||
<property name="title" translatable="yes">Asistente</property> |
||||
<child> |
||||
<object class="GtkCellRendererText"/> |
||||
<attributes> |
||||
<attribute name="markup">4</attribute> |
||||
</attributes> |
||||
</child> |
||||
</object> |
||||
</child> |
||||
</object> |
||||
<object class="GtkTreeView" id="query_tree_q2"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">True</property> |
||||
<property name="model">liststore1</property> |
||||
<property name="headers_clickable">False</property> |
||||
<property name="enable_search">False</property> |
||||
<property name="fixed_height_mode">True</property> |
||||
<property name="show_expanders">False</property> |
||||
<property name="enable_grid_lines">both</property> |
||||
<property name="enable_tree_lines">True</property> |
||||
<child internal-child="selection"> |
||||
<object class="GtkTreeSelection"> |
||||
<property name="mode">none</property> |
||||
</object> |
||||
</child> |
||||
<child> |
||||
<object class="GtkTreeViewColumn" id="profesor"> |
||||
<property name="sizing">fixed</property> |
||||
<property name="title" translatable="yes">Profesor</property> |
||||
<child> |
||||
<object class="GtkCellRendererText"/> |
||||
<attributes> |
||||
<attribute name="markup">0</attribute> |
||||
</attributes> |
||||
</child> |
||||
</object> |
||||
</child> |
||||
</object> |
||||
<object class="GtkTreeView" id="query_tree_q3"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">True</property> |
||||
<property name="model">liststore1</property> |
||||
<property name="headers_clickable">False</property> |
||||
<property name="enable_search">False</property> |
||||
<property name="fixed_height_mode">True</property> |
||||
<property name="show_expanders">False</property> |
||||
<property name="enable_grid_lines">both</property> |
||||
<property name="enable_tree_lines">True</property> |
||||
<child internal-child="selection"> |
||||
<object class="GtkTreeSelection"> |
||||
<property name="mode">none</property> |
||||
</object> |
||||
</child> |
||||
<child> |
||||
<object class="GtkTreeViewColumn" id="nombre_q3"> |
||||
<property name="sizing">fixed</property> |
||||
<property name="title" translatable="yes">Nombre</property> |
||||
<child> |
||||
<object class="GtkCellRendererText"/> |
||||
<attributes> |
||||
<attribute name="markup">0</attribute> |
||||
</attributes> |
||||
</child> |
||||
</object> |
||||
</child> |
||||
<child> |
||||
<object class="GtkTreeViewColumn" id="cantidad_q3"> |
||||
<property name="sizing">fixed</property> |
||||
<property name="title" translatable="yes">Cantidad</property> |
||||
<child> |
||||
<object class="GtkCellRendererText"/> |
||||
<attributes> |
||||
<attribute name="markup">1</attribute> |
||||
</attributes> |
||||
</child> |
||||
</object> |
||||
</child> |
||||
</object> |
||||
<object class="GtkTreeView" id="query_tree_q4"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">True</property> |
||||
<property name="model">liststore1</property> |
||||
<property name="headers_clickable">False</property> |
||||
<property name="enable_search">False</property> |
||||
<property name="fixed_height_mode">True</property> |
||||
<property name="show_expanders">False</property> |
||||
<property name="enable_grid_lines">both</property> |
||||
<property name="enable_tree_lines">True</property> |
||||
<child internal-child="selection"> |
||||
<object class="GtkTreeSelection"> |
||||
<property name="mode">none</property> |
||||
</object> |
||||
</child> |
||||
<child> |
||||
<object class="GtkTreeViewColumn" id="curso_q4"> |
||||
<property name="sizing">fixed</property> |
||||
<property name="title" translatable="yes">Curso</property> |
||||
<child> |
||||
<object class="GtkCellRendererText"/> |
||||
<attributes> |
||||
<attribute name="markup">0</attribute> |
||||
</attributes> |
||||
</child> |
||||
</object> |
||||
</child> |
||||
<child> |
||||
<object class="GtkTreeViewColumn" id="cantidad_q4"> |
||||
<property name="sizing">fixed</property> |
||||
<property name="title" translatable="yes">Cantidad</property> |
||||
<child> |
||||
<object class="GtkCellRendererText"/> |
||||
<attributes> |
||||
<attribute name="markup">1</attribute> |
||||
</attributes> |
||||
</child> |
||||
</object> |
||||
</child> |
||||
</object> |
||||
<object class="GtkTreeView" id="query_tree_q5"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">True</property> |
||||
<property name="model">liststore1</property> |
||||
<property name="headers_clickable">False</property> |
||||
<property name="enable_search">False</property> |
||||
<property name="fixed_height_mode">True</property> |
||||
<property name="show_expanders">False</property> |
||||
<property name="enable_grid_lines">both</property> |
||||
<property name="enable_tree_lines">True</property> |
||||
<child internal-child="selection"> |
||||
<object class="GtkTreeSelection"> |
||||
<property name="mode">none</property> |
||||
</object> |
||||
</child> |
||||
<child> |
||||
<object class="GtkTreeViewColumn" id="nombre_q5"> |
||||
<property name="sizing">fixed</property> |
||||
<property name="title" translatable="yes">Nombre</property> |
||||
<child> |
||||
<object class="GtkCellRendererText"/> |
||||
<attributes> |
||||
<attribute name="markup">0</attribute> |
||||
</attributes> |
||||
</child> |
||||
</object> |
||||
</child> |
||||
<child> |
||||
<object class="GtkTreeViewColumn" id="promedio"> |
||||
<property name="sizing">fixed</property> |
||||
<property name="title" translatable="yes">Promedio</property> |
||||
<child> |
||||
<object class="GtkCellRendererText"/> |
||||
<attributes> |
||||
<attribute name="markup">1</attribute> |
||||
</attributes> |
||||
</child> |
||||
</object> |
||||
</child> |
||||
</object> |
||||
<object class="GtkTreeView" id="query_tree_q6"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">True</property> |
||||
<property name="model">liststore1</property> |
||||
<property name="headers_clickable">False</property> |
||||
<property name="enable_search">False</property> |
||||
<property name="fixed_height_mode">True</property> |
||||
<property name="show_expanders">False</property> |
||||
<property name="enable_grid_lines">both</property> |
||||
<property name="enable_tree_lines">True</property> |
||||
<child internal-child="selection"> |
||||
<object class="GtkTreeSelection"/> |
||||
</child> |
||||
<child> |
||||
<object class="GtkTreeViewColumn" id="nombre_q6"> |
||||
<property name="sizing">fixed</property> |
||||
<property name="title" translatable="yes">Nombre</property> |
||||
<child> |
||||
<object class="GtkCellRendererText"/> |
||||
<attributes> |
||||
<attribute name="markup">0</attribute> |
||||
</attributes> |
||||
</child> |
||||
</object> |
||||
</child> |
||||
<child> |
||||
<object class="GtkTreeViewColumn"> |
||||
<property name="sizing">fixed</property> |
||||
<property name="title" translatable="yes">Porcentaje</property> |
||||
<child> |
||||
<object class="GtkCellRendererText"/> |
||||
<attributes> |
||||
<attribute name="markup">1</attribute> |
||||
</attributes> |
||||
</child> |
||||
</object> |
||||
</child> |
||||
</object> |
||||
</interface> |
@ -0,0 +1,243 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- Generated with glade 3.22.1 |
||||
|
||||
Copyright 2019 Chris Cromer |
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. |
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. |
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
--> |
||||
<interface domain="colegio"> |
||||
<requires lib="gtk+" version="3.20"/> |
||||
<template class="ColegioQueryWindow" parent="GtkApplicationWindow"> |
||||
<property name="can_focus">False</property> |
||||
<property name="type">popup</property> |
||||
<property name="modal">True</property> |
||||
<property name="window_position">center-on-parent</property> |
||||
<property name="default_width">800</property> |
||||
<property name="default_height">600</property> |
||||
<property name="destroy_with_parent">True</property> |
||||
<property name="type_hint">dialog</property> |
||||
<property name="skip_taskbar_hint">True</property> |
||||
<property name="skip_pager_hint">True</property> |
||||
<property name="show_menubar">False</property> |
||||
<child type="titlebar"> |
||||
<placeholder/> |
||||
</child> |
||||
<child> |
||||
<object class="GtkGrid"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">True</property> |
||||
<property name="hexpand">True</property> |
||||
<child> |
||||
<object class="GtkScrolledWindow" id="scroll_window"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">True</property> |
||||
<property name="halign">center</property> |
||||
<property name="hexpand">True</property> |
||||
<property name="vexpand">True</property> |
||||
<property name="hscrollbar_policy">never</property> |
||||
<property name="shadow_type">in</property> |
||||
<child> |
||||
<placeholder/> |
||||
</child> |
||||
</object> |
||||
<packing> |
||||
<property name="left_attach">0</property> |
||||
<property name="top_attach">1</property> |
||||
</packing> |
||||
</child> |
||||
<child> |
||||
<object class="GtkBox"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">False</property> |
||||
<property name="halign">center</property> |
||||
<property name="hexpand">True</property> |
||||
<property name="spacing">25</property> |
||||
<child> |
||||
<object class="GtkButton" id="close_query"> |
||||
<property name="label" translatable="yes">Close</property> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">True</property> |
||||
<property name="receives_default">True</property> |
||||
<property name="margin_left">5</property> |
||||
<property name="margin_right">5</property> |
||||
<property name="margin_top">5</property> |
||||
<property name="margin_bottom">5</property> |
||||
<signal name="clicked" handler="on_clicked_button" swapped="no"/> |
||||
</object> |
||||
<packing> |
||||
<property name="expand">False</property> |
||||
<property name="fill">True</property> |
||||
<property name="position">0</property> |
||||
</packing> |
||||
</child> |
||||
<child> |
||||
<object class="GtkButton" id="run_query"> |
||||
<property name="label" translatable="yes">Run</property> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">True</property> |
||||
<property name="receives_default">True</property> |
||||
<property name="margin_left">5</property> |
||||
<property name="margin_right">5</property> |
||||
<property name="margin_top">5</property> |
||||
<property name="margin_bottom">5</property> |
||||
<signal name="clicked" handler="on_clicked_button" swapped="no"/> |
||||
</object> |
||||
<packing> |
||||
<property name="expand">False</property> |
||||
<property name="fill">True</property> |
||||
<property name="position">1</property> |
||||
</packing> |
||||
</child> |
||||
</object> |
||||
<packing> |
||||
<property name="left_attach">0</property> |
||||
<property name="top_attach">2</property> |
||||
</packing> |
||||
</child> |
||||
<child> |
||||
<object class="GtkGrid"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">False</property> |
||||
<property name="hexpand">True</property> |
||||
<child> |
||||
<object class="GtkFrame"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">False</property> |
||||
<property name="label_xalign">0</property> |
||||
<property name="label_yalign">0</property> |
||||
<property name="shadow_type">out</property> |
||||
<child> |
||||
<object class="GtkLabel"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">False</property> |
||||
<property name="margin_left">5</property> |
||||
<property name="margin_right">5</property> |
||||
<property name="margin_top">5</property> |
||||
<property name="margin_bottom">5</property> |
||||
<property name="label" translatable="yes">Statement</property> |
||||
<attributes> |
||||
<attribute name="font-desc" value="Sans Bold 6"/> |
||||
</attributes> |
||||
</object> |
||||
</child> |
||||
<child type="label_item"> |
||||
<placeholder/> |
||||
</child> |
||||
</object> |
||||
<packing> |
||||
<property name="left_attach">0</property> |
||||
<property name="top_attach">0</property> |
||||
</packing> |
||||
</child> |
||||
<child> |
||||
<object class="GtkFrame"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">False</property> |
||||
<property name="label_xalign">0</property> |
||||
<property name="label_yalign">0</property> |
||||
<property name="shadow_type">out</property> |
||||
<child> |
||||
<object class="GtkLabel"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">False</property> |
||||
<property name="margin_left">5</property> |
||||
<property name="margin_right">5</property> |
||||
<property name="margin_top">5</property> |
||||
<property name="margin_bottom">5</property> |
||||
<property name="label" translatable="yes">View and Query</property> |
||||
<attributes> |
||||
<attribute name="font-desc" value="Sans Bold 6"/> |
||||
</attributes> |
||||
</object> |
||||
</child> |
||||
<child type="label_item"> |
||||
<placeholder/> |
||||
</child> |
||||
</object> |
||||
<packing> |
||||
<property name="left_attach">0</property> |
||||
<property name="top_attach">1</property> |
||||
</packing> |
||||
</child> |
||||
<child> |
||||
<object class="GtkFrame"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">False</property> |
||||
<property name="hexpand">True</property> |
||||
<property name="label_xalign">0</property> |
||||
<property name="label_yalign">0</property> |
||||
<property name="shadow_type">out</property> |
||||
<child> |
||||
<object class="GtkLabel" id="statement"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">False</property> |
||||
<property name="halign">start</property> |
||||
<property name="margin_left">5</property> |
||||
<property name="margin_right">5</property> |
||||
<property name="margin_top">5</property> |
||||
<property name="margin_bottom">5</property> |
||||
<property name="wrap">True</property> |
||||
<attributes> |
||||
<attribute name="font-desc" value="Sans 6"/> |
||||
</attributes> |
||||
</object> |
||||
</child> |
||||
<child type="label_item"> |
||||
<placeholder/> |
||||
</child> |
||||
</object> |
||||
<packing> |
||||
<property name="left_attach">1</property> |
||||
<property name="top_attach">0</property> |
||||
</packing> |
||||
</child> |
||||
<child> |
||||
<object class="GtkFrame"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">False</property> |
||||
<property name="hexpand">True</property> |
||||
<property name="label_xalign">0</property> |
||||
<property name="label_yalign">0</property> |
||||
<property name="shadow_type">out</property> |
||||
<child> |
||||
<object class="GtkLabel" id="sql"> |
||||
<property name="visible">True</property> |
||||
<property name="can_focus">False</property> |
||||
<property name="halign">start</property> |
||||
<property name="margin_left">5</property> |
||||
<property name="margin_right">5</property> |
||||
<property name="margin_top">5</property> |
||||
<property name="margin_bottom">5</property> |
||||
<attributes> |
||||
<attribute name="font-desc" value="Monospace 6"/> |
||||
</attributes> |
||||
</object> |
||||
</child> |
||||
<child type="label_item"> |
||||
<placeholder/> |
||||
</child> |
||||
</object> |
||||
<packing> |
||||
<property name="left_attach">1</property> |
||||
<property name="top_attach">1</property> |
||||
</packing> |
||||
</child> |
||||
</object> |
||||
<packing> |
||||
<property name="left_attach">0</property> |
||||
<property name="top_attach">0</property> |
||||
</packing> |
||||
</child> |
||||
</object> |
||||
</child> |
||||
</template> |
||||
</interface> |
@ -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} |
Binary file not shown.
After Width: | Height: | Size: 54 KiB |
@ -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 |
||||
); |
@ -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'); |
After Width: | Height: | Size: 185 KiB |
@ -0,0 +1,194 @@ |
||||
\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, |
||||
inputencoding=utf8, |
||||
extendedchars=true, |
||||
literate={á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1 {ñ}{{\~n}}1 {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1 {Ñ}{{\~N}}1, |
||||
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 Corregido}} |
||||
\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} |