• Like
  • Save

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this document? Why not share!

Modelo conceptual de BD

on

  • 675 views

Diseño Conceptual de la base de datos

Diseño Conceptual de la base de datos

Statistics

Views

Total Views
675
Views on SlideShare
675
Embed Views
0

Actions

Likes
0
Downloads
19
Comments
1

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft Word

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • HOLA UN BUEN TRABAJO
    ME GUSTARIA QUE ME AYUDES CON UN TAREA ES SOBRE LOS MODELOS CONCEPTUALES DEL DISEÑO DE BASE DE DATOS ORIENTADOS A OBJETOS
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Modelo conceptual de BD Modelo conceptual de BD Document Transcript

    • Universidad Técnica Particular de Loja<br />BASE DE DATOS<br />PRIMER BIMESTRE<br />Ing. Juan Carlos Morocho<br />Alumna: Marilyn Jaramillo<br />2009<br />1Cree un modelo conceptual de los datos y compruebe que soporta las transacciones requeridas, para ello utilice cualquiera de los dos métodos estudiados en el capítulo 1 Diseño Conceptual de la base de datos<br />ENTIDADES<br />Factura<br />Pago de factura<br />Consejero<br />Estudiante<br />Residencia<br />Curso<br />Pariente<br />Contrato<br />Inspeccion<br />Empleado<br />Habitacion<br />DIAGRAMA CONCEPTUAL<br />2 Genere el modelo de datos lógico a partir del modelo conceptual:<br />DIAGRAMA FISICO<br />/*==============================================================*/<br />/* DBMS name: Sybase SQL Anywhere 10 */<br />/* Created on: 11/05/2009 17:22:14 */<br />/*==============================================================*/<br />if exists(select 1 from sys.sysforeignkey where role='FK_CONTRATO_REALIZA_ESTUDIAN') then<br /> alter table CONTRATO<br /> delete foreign key FK_CONTRATO_REALIZA_ESTUDIAN<br />end if;<br />if exists(select 1 from sys.sysforeignkey where role='FK_CURSOS_PERTENECE_ESTUDIAN') then<br /> alter table CURSOS<br /> delete foreign key FK_CURSOS_PERTENECE_ESTUDIAN<br />end if;<br />if exists(select 1 from sys.sysforeignkey where role='FK_EMPLEADO_RELATIONS_ESTUDIAN') then<br /> alter table EMPLEADO<br /> delete foreign key FK_EMPLEADO_RELATIONS_ESTUDIAN<br />end if;<br />if exists(select 1 from sys.sysforeignkey where role='FK_ESTUDIAN_ENVIA_FACTURA') then<br /> alter table ESTUDIANTE<br /> delete foreign key FK_ESTUDIAN_ENVIA_FACTURA<br />end if;<br />if exists(select 1 from sys.sysforeignkey where role='FK_FACTURA_ENVIA2_ESTUDIAN') then<br /> alter table FACTURA<br /> delete foreign key FK_FACTURA_ENVIA2_ESTUDIAN<br />end if;<br />if exists(select 1 from sys.sysforeignkey where role='FK_PAGO_TIENEF_FACTURA') then<br /> alter table PAGO<br /> delete foreign key FK_PAGO_TIENEF_FACTURA<br />end if;<br />if exists(select 1 from sys.sysforeignkey where role='FK_PARIENTE_TIENE_ESTUDIAN') then<br /> alter table PARIENTE<br /> delete foreign key FK_PARIENTE_TIENE_ESTUDIAN<br />end if;<br />if exists(select 1 from sys.sysforeignkey where role='FK_PISO_RELATIONS_HABITACI') then<br /> alter table PISO<br /> delete foreign key FK_PISO_RELATIONS_HABITACI<br />end if;<br />if exists(select 1 from sys.sysforeignkey where role='FK_REALIAZA_REALIAZA_INSPECCI') then<br /> alter table REALIAZA<br /> delete foreign key FK_REALIAZA_REALIAZA_INSPECCI<br />end if;<br />if exists(select 1 from sys.sysforeignkey where role='FK_REALIAZA_REALIAZA2_PISO') then<br /> alter table REALIAZA<br /> delete foreign key FK_REALIAZA_REALIAZA2_PISO<br />end if;<br />if exists(select 1 from sys.sysforeignkey where role='FK_RESIDENC_PERTENECE_ESTUDIAN') then<br /> alter table RESIDENCIA<br /> delete foreign key FK_RESIDENC_PERTENECE_ESTUDIAN<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='REALIZA_FK'<br /> and t.table_name='CONTRATO'<br />) then<br /> drop index CONTRATO.REALIZA_FK<br />end if;<br />if exists(<br /> select 1 from sys.systable <br /> where table_name='CONTRATO'<br /> and table_type in ('BASE', 'GBL TEMP')<br />) then<br /> drop table CONTRATO<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='PERTENECE_FK'<br /> and t.table_name='CURSOS'<br />) then<br /> drop index CURSOS.PERTENECE_FK<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='CURSOS_PK'<br /> and t.table_name='CURSOS'<br />) then<br /> drop index CURSOS.CURSOS_PK<br />end if;<br />if exists(<br /> select 1 from sys.systable <br /> where table_name='CURSOS'<br /> and table_type in ('BASE', 'GBL TEMP')<br />) then<br /> drop table CURSOS<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='RELATIONSHIP_11_FK'<br /> and t.table_name='EMPLEADO'<br />) then<br /> drop index EMPLEADO.RELATIONSHIP_11_FK<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='EMPLEADO_PK'<br /> and t.table_name='EMPLEADO'<br />) then<br /> drop index EMPLEADO.EMPLEADO_PK<br />end if;<br />if exists(<br /> select 1 from sys.systable <br /> where table_name='EMPLEADO'<br /> and table_type in ('BASE', 'GBL TEMP')<br />) then<br /> drop table EMPLEADO<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='PERTENECER_FK'<br /> and t.table_name='ESTUDIANTE'<br />) then<br /> drop index ESTUDIANTE.PERTENECER_FK<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='ENVIA_FK'<br /> and t.table_name='ESTUDIANTE'<br />) then<br /> drop index ESTUDIANTE.ENVIA_FK<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='ESTUDIANTE_PK'<br /> and t.table_name='ESTUDIANTE'<br />) then<br /> drop index ESTUDIANTE.ESTUDIANTE_PK<br />end if;<br />if exists(<br /> select 1 from sys.systable <br /> where table_name='ESTUDIANTE'<br /> and table_type in ('BASE', 'GBL TEMP')<br />) then<br /> drop table ESTUDIANTE<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='ENVIA2_FK'<br /> and t.table_name='FACTURA'<br />) then<br /> drop index FACTURA.ENVIA2_FK<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='FACTURA_PK'<br /> and t.table_name='FACTURA'<br />) then<br /> drop index FACTURA.FACTURA_PK<br />end if;<br />if exists(<br /> select 1 from sys.systable <br /> where table_name='FACTURA'<br /> and table_type in ('BASE', 'GBL TEMP')<br />) then<br /> drop table FACTURA<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='HABITACION_PK'<br /> and t.table_name='HABITACION'<br />) then<br /> drop index HABITACION.HABITACION_PK<br />end if;<br />if exists(<br /> select 1 from sys.systable <br /> where table_name='HABITACION'<br /> and table_type in ('BASE', 'GBL TEMP')<br />) then<br /> drop table HABITACION<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='INSPECCION_PK'<br /> and t.table_name='INSPECCION'<br />) then<br /> drop index INSPECCION.INSPECCION_PK<br />end if;<br />if exists(<br /> select 1 from sys.systable <br /> where table_name='INSPECCION'<br /> and table_type in ('BASE', 'GBL TEMP')<br />) then<br /> drop table INSPECCION<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='TIENEF_FK'<br /> and t.table_name='PAGO'<br />) then<br /> drop index PAGO.TIENEF_FK<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='PAGO_PK'<br /> and t.table_name='PAGO'<br />) then<br /> drop index PAGO.PAGO_PK<br />end if;<br />if exists(<br /> select 1 from sys.systable <br /> where table_name='PAGO'<br /> and table_type in ('BASE', 'GBL TEMP')<br />) then<br /> drop table PAGO<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='TIENE_FK'<br /> and t.table_name='PARIENTE'<br />) then<br /> drop index PARIENTE.TIENE_FK<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='PARIENTE_PK'<br /> and t.table_name='PARIENTE'<br />) then<br /> drop index PARIENTE.PARIENTE_PK<br />end if;<br />if exists(<br /> select 1 from sys.systable <br /> where table_name='PARIENTE'<br /> and table_type in ('BASE', 'GBL TEMP')<br />) then<br /> drop table PARIENTE<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='RELATIONSHIP_8_FK'<br /> and t.table_name='PISO'<br />) then<br /> drop index PISO.RELATIONSHIP_8_FK<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='PISO_PK'<br /> and t.table_name='PISO'<br />) then<br /> drop index PISO.PISO_PK<br />end if;<br />if exists(<br /> select 1 from sys.systable <br /> where table_name='PISO'<br /> and table_type in ('BASE', 'GBL TEMP')<br />) then<br /> drop table PISO<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='REALIAZA2_FK'<br /> and t.table_name='REALIAZA'<br />) then<br /> drop index REALIAZA.REALIAZA2_FK<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='REALIAZA_FK'<br /> and t.table_name='REALIAZA'<br />) then<br /> drop index REALIAZA.REALIAZA_FK<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='REALIAZA_PK'<br /> and t.table_name='REALIAZA'<br />) then<br /> drop index REALIAZA.REALIAZA_PK<br />end if;<br />if exists(<br /> select 1 from sys.systable <br /> where table_name='REALIAZA'<br /> and table_type in ('BASE', 'GBL TEMP')<br />) then<br /> drop table REALIAZA<br />end if;<br />if exists(<br /> select 1 from sys.sysindex i, sys.systable t<br /> where i.table_id=t.table_id <br /> and i.index_name='RESIDENCIA_AK'<br /> and t.table_name='RESIDENCIA'<br />) then<br /> drop index RESIDENCIA.RESIDENCIA_AK<br />end if;<br />if exists(<br /> select 1 from sys.systable <br /> where table_name='RESIDENCIA'<br /> and table_type in ('BASE', 'GBL TEMP')<br />) then<br /> drop table RESIDENCIA<br />end if;<br />/*==============================================================*/<br />/* Table: CONTRATO */<br />/*==============================================================*/<br />create table CONTRATO <br />(<br /> ID_ESTUDIANTE varchar(10),<br /> NUM_A varchar(5) not null,<br /> TIEMPO varchar(15),<br /> INICIO_ALQ varchar(15),<br /> FINAL_ALQ date,<br /> PERIODO_MIN date<br />);<br />/*==============================================================*/<br />/* Index: REALIZA_FK */<br />/*==============================================================*/<br />create index REALIZA_FK on CONTRATO (<br />ID_ESTUDIANTE ASC<br />);<br />/*==============================================================*/<br />/* Table: CURSOS */<br />/*==============================================================*/<br />create table CURSOS <br />(<br /> NUM_CURSO varchar(5) not null,<br /> ID_ESTUDIANTE varchar(10),<br /> TITULO_CURSO varchar(25),<br /> ID_EMPLEADO varchar(10),<br /> constraint PK_CURSOS primary key (NUM_CURSO)<br />);<br />/*==============================================================*/<br />/* Index: CURSOS_PK */<br />/*==============================================================*/<br />create unique index CURSOS_PK on CURSOS (<br />NUM_CURSO ASC<br />);<br />/*==============================================================*/<br />/* Index: PERTENECE_FK */<br />/*==============================================================*/<br />create index PERTENECE_FK on CURSOS (<br />ID_ESTUDIANTE ASC<br />);<br />/*==============================================================*/<br />/* Table: EMPLEADO */<br />/*==============================================================*/<br />create table EMPLEADO <br />(<br /> ID_ESTUDIANTE2 varchar(10) not null,<br /> ID_ESTUDIANTE varchar(10),<br /> NOMBRE_EMPLEADO varchar(25),<br /> APELLIDO_EMPLEADO varchar(25),<br /> FECHA_NAC_EMPLEADO date,<br /> SEXO_EMPLEADO varchar(2),<br /> CATEGORIA_EMPLEADO varchar(30) <br /> constraint CKC_CATEGORIA_EMPLEAD_EMPLEADO check (CATEGORIA_EMPLEADO is null or (CATEGORIA_EMPLEADO between '30' and '30' and CATEGORIA_EMPLEADO = lower(CATEGORIA_EMPLEADO))),<br /> constraint PK_EMPLEADO primary key (ID_ESTUDIANTE2)<br />);<br />/*==============================================================*/<br />/* Index: EMPLEADO_PK */<br />/*==============================================================*/<br />create unique index EMPLEADO_PK on EMPLEADO (<br />ID_ESTUDIANTE2 ASC<br />);<br />/*==============================================================*/<br />/* Index: RELATIONSHIP_11_FK */<br />/*==============================================================*/<br />create index RELATIONSHIP_11_FK on EMPLEADO (<br />ID_ESTUDIANTE ASC<br />);<br />/*==============================================================*/<br />/* Table: ESTUDIANTE */<br />/*==============================================================*/<br />create table ESTUDIANTE <br />(<br /> ID_ESTUDIANTE varchar(10) not null,<br /> NUM_FACTURA varchar(5),<br /> NUM_MATRICULA varchar(5) not null,<br /> NOMBRE_ESTUDIANTE varchar(25),<br /> APELLIDO_ESTUDIANTE varchar(25),<br /> FECHA_NAC_EMPLEADO date,<br /> SEXO_EMPLEADO varchar(2),<br /> CATEGORIA_EMPLEADO varchar(30) <br /> constraint CKC_CATEGORIA_EMPLEAD_ESTUDIAN check (CATEGORIA_EMPLEADO is null or (CATEGORIA_EMPLEADO between '30' and '30' and CATEGORIA_EMPLEADO = lower(CATEGORIA_EMPLEADO))),<br /> NACIONALIDAD varchar(15),<br /> ESTADO_FUMADOR varchar(6),<br /> ESTADO_ACTUAL varchar(15),<br /> CURSO varchar(15),<br /> NECESIDADES varchar(50),<br /> COMENTARIOS varchar(50) <br /> constraint CKC_COMENTARIOS_ESTUDIAN check (COMENTARIOS is null or (COMENTARIOS between '0' and '30' and COMENTARIOS = lower(COMENTARIOS))),<br /> constraint PK_ESTUDIANTE primary key (ID_ESTUDIANTE)<br />);<br />/*==============================================================*/<br />/* Index: ESTUDIANTE_PK */<br />/*==============================================================*/<br />create unique index ESTUDIANTE_PK on ESTUDIANTE (<br />ID_ESTUDIANTE ASC<br />);<br />/*==============================================================*/<br />/* Index: ENVIA_FK */<br />/*==============================================================*/<br />create index ENVIA_FK on ESTUDIANTE (<br />NUM_FACTURA ASC<br />);<br />/*==============================================================*/<br />/* Index: PERTENECER_FK */<br />/*==============================================================*/<br />create index PERTENECER_FK on ESTUDIANTE (<br />ID_ESTUDIANTE ASC<br />);<br />/*==============================================================*/<br />/* Table: FACTURA */<br />/*==============================================================*/<br />create table FACTURA <br />(<br /> NUM_FACTURA varchar(5) not null,<br /> ID_ESTUDIANTE varchar(10),<br /> NUM_A varchar(5),<br /> SEMESTRE varchar(10),<br /> TIPO_PAGO float,<br /> constraint PK_FACTURA primary key (NUM_FACTURA)<br />);<br />/*==============================================================*/<br />/* Index: FACTURA_PK */<br />/*==============================================================*/<br />create unique index FACTURA_PK on FACTURA (<br />NUM_FACTURA ASC<br />);<br />/*==============================================================*/<br />/* Index: ENVIA2_FK */<br />/*==============================================================*/<br />create index ENVIA2_FK on FACTURA (<br />ID_ESTUDIANTE ASC<br />);<br />/*==============================================================*/<br />/* Table: HABITACION */<br />/*==============================================================*/<br />create table HABITACION <br />(<br /> NUM_IDENTIFICACION_HABITACION varchar(5) not null,<br /> NUM_HABITACION integer not null,<br /> IMPORTE_MENSUAL float,<br /> constraint PK_HABITACION primary key (NUM_IDENTIFICACION_HABITACION)<br />);<br />/*==============================================================*/<br />/* Index: HABITACION_PK */<br />/*==============================================================*/<br />create unique index HABITACION_PK on HABITACION (<br />NUM_IDENTIFICACION_HABITACION ASC<br />);<br />/*==============================================================*/<br />/* Table: INSPECCION */<br />/*==============================================================*/<br />create table INSPECCION <br />(<br /> ID_INSPECCION varchar(5) not null,<br /> FECHA_INSPECCION date,<br /> ESTADO_INMUEBLE varchar(15),<br /> COMENTARIOS varchar(50) <br /> constraint CKC_COMENTARIOS_INSPECCI check (COMENTARIOS is null or (COMENTARIOS between '0' and '30' and COMENTARIOS = lower(COMENTARIOS))),<br /> constraint PK_INSPECCION primary key (ID_INSPECCION)<br />);<br />/*==============================================================*/<br />/* Index: INSPECCION_PK */<br />/*==============================================================*/<br />create unique index INSPECCION_PK on INSPECCION (<br />ID_INSPECCION ASC<br />);<br />/*==============================================================*/<br />/* Table: PAGO */<br />/*==============================================================*/<br />create table PAGO <br />(<br /> NUM_PAGO_FACTURA varchar(5) not null,<br /> NUM_FACTURA varchar(5),<br /> FECHA_PAGO date,<br /> MODO_PAGO varchar(10),<br /> FECHA_RECORDATORIO date,<br /> constraint PK_PAGO primary key (NUM_PAGO_FACTURA)<br />);<br />/*==============================================================*/<br />/* Index: PAGO_PK */<br />/*==============================================================*/<br />create unique index PAGO_PK on PAGO (<br />NUM_PAGO_FACTURA ASC<br />);<br />/*==============================================================*/<br />/* Index: TIENEF_FK */<br />/*==============================================================*/<br />create index TIENEF_FK on PAGO (<br />NUM_FACTURA ASC<br />);<br />/*==============================================================*/<br />/* Table: PARIENTE */<br />/*==============================================================*/<br />create table PARIENTE <br />(<br /> ID_PARIENTE varchar(10) not null,<br /> ID_ESTUDIANTE varchar(10),<br /> RELACION varchar(25),<br /> DIRECCION varchar(30),<br /> NUM_FONO varchar(15),<br /> constraint PK_PARIENTE primary key (ID_PARIENTE)<br />);<br />/*==============================================================*/<br />/* Index: PARIENTE_PK */<br />/*==============================================================*/<br />create unique index PARIENTE_PK on PARIENTE (<br />ID_PARIENTE ASC<br />);<br />/*==============================================================*/<br />/* Index: TIENE_FK */<br />/*==============================================================*/<br />create index TIENE_FK on PARIENTE (<br />ID_ESTUDIANTE ASC<br />);<br />/*==============================================================*/<br />/* Table: PISO */<br />/*==============================================================*/<br />create table PISO <br />(<br /> NUM_APARTAMENTO varchar(5) not null,<br /> NUM_IDENTIFICACION_HABITACION varchar(5),<br /> CAPACIDAD_ESTUDIANTES integer,<br /> DIRECCION_APARTAMENTO varchar(30),<br /> NUM_HABITACION integer,<br /> constraint PK_PISO primary key (NUM_APARTAMENTO)<br />);<br />/*==============================================================*/<br />/* Index: PISO_PK */<br />/*==============================================================*/<br />create unique index PISO_PK on PISO (<br />NUM_APARTAMENTO ASC<br />);<br />/*==============================================================*/<br />/* Index: RELATIONSHIP_8_FK */<br />/*==============================================================*/<br />create index RELATIONSHIP_8_FK on PISO (<br />NUM_IDENTIFICACION_HABITACION ASC<br />);<br />/*==============================================================*/<br />/* Table: REALIAZA */<br />/*==============================================================*/<br />create table REALIAZA <br />(<br /> ID_INSPECCION varchar(5) not null,<br /> NUM_APARTAMENTO varchar(5) not null,<br /> constraint PK_REALIAZA primary key clustered (ID_INSPECCION, NUM_APARTAMENTO)<br />);<br />/*==============================================================*/<br />/* Index: REALIAZA_PK */<br />/*==============================================================*/<br />create unique clustered index REALIAZA_PK on REALIAZA (<br />ID_INSPECCION ASC,<br />NUM_APARTAMENTO ASC<br />);<br />/*==============================================================*/<br />/* Index: REALIAZA_FK */<br />/*==============================================================*/<br />create index REALIAZA_FK on REALIAZA (<br />ID_INSPECCION ASC<br />);<br />/*==============================================================*/<br />/* Index: REALIAZA2_FK */<br />/*==============================================================*/<br />create index REALIAZA2_FK on REALIAZA (<br />NUM_APARTAMENTO ASC<br />);<br />/*==============================================================*/<br />/* Table: RESIDENCIA */<br />/*==============================================================*/<br />create table RESIDENCIA <br />(<br /> ID_ESTUDIANTE varchar(10),<br /> ID_RESIDENCIA varchar(5) not null,<br /> NOMBRE_RESIDENCIA varchar(25),<br /> DIRECCION_RESIDENCIA varchar(30),<br /> NUM_TELEFONO varchar(15),<br /> constraint AK_ID_RESIDENCIA_RESIDENC unique (ID_RESIDENCIA)<br />);<br />/*==============================================================*/<br />/* Index: RESIDENCIA_AK */<br />/*==============================================================*/<br />create unique index RESIDENCIA_AK on RESIDENCIA (<br />ID_RESIDENCIA ASC<br />);<br />alter table CONTRATO<br /> add constraint FK_CONTRATO_REALIZA_ESTUDIAN foreign key (ID_ESTUDIANTE)<br /> references ESTUDIANTE (ID_ESTUDIANTE)<br /> on update restrict<br /> on delete restrict;<br />alter table CURSOS<br /> add constraint FK_CURSOS_PERTENECE_ESTUDIAN foreign key (ID_ESTUDIANTE)<br /> references ESTUDIANTE (ID_ESTUDIANTE)<br /> on update restrict<br /> on delete restrict;<br />alter table EMPLEADO<br /> add constraint FK_EMPLEADO_RELATIONS_ESTUDIAN foreign key (ID_ESTUDIANTE)<br /> references ESTUDIANTE (ID_ESTUDIANTE)<br /> on update restrict<br /> on delete restrict;<br />alter table ESTUDIANTE<br /> add constraint FK_ESTUDIAN_ENVIA_FACTURA foreign key (NUM_FACTURA)<br /> references FACTURA (NUM_FACTURA)<br /> on update restrict<br /> on delete restrict;<br />alter table FACTURA<br /> add constraint FK_FACTURA_ENVIA2_ESTUDIAN foreign key (ID_ESTUDIANTE)<br /> references ESTUDIANTE (ID_ESTUDIANTE)<br /> on update restrict<br /> on delete restrict;<br />alter table PAGO<br /> add constraint FK_PAGO_TIENEF_FACTURA foreign key (NUM_FACTURA)<br /> references FACTURA (NUM_FACTURA)<br /> on update restrict<br /> on delete restrict;<br />alter table PARIENTE<br /> add constraint FK_PARIENTE_TIENE_ESTUDIAN foreign key (ID_ESTUDIANTE)<br /> references ESTUDIANTE (ID_ESTUDIANTE)<br /> on update restrict<br /> on delete restrict;<br />alter table PISO<br /> add constraint FK_PISO_RELATIONS_HABITACI foreign key (NUM_IDENTIFICACION_HABITACION)<br /> references HABITACION (NUM_IDENTIFICACION_HABITACION)<br /> on update restrict<br /> on delete restrict;<br />alter table REALIAZA<br /> add constraint FK_REALIAZA_REALIAZA_INSPECCI foreign key (ID_INSPECCION)<br /> references INSPECCION (ID_INSPECCION)<br /> on update restrict<br /> on delete restrict;<br />alter table REALIAZA<br /> add constraint FK_REALIAZA_REALIAZA2_PISO foreign key (NUM_APARTAMENTO)<br /> references PISO (NUM_APARTAMENTO)<br /> on update restrict<br /> on delete restrict;<br />alter table RESIDENCIA<br /> add constraint FK_RESIDENC_PERTENECE_ESTUDIAN foreign key (ID_ESTUDIANTE)<br /> references ESTUDIANTE (ID_ESTUDIANTE)<br /> on update restrict<br /> on delete restrict;<br />3. Basándose en el caso de esdio, identifique las potenciales amenaas a las que tendría que enfrentarse y proponga contramedidas para prevenirlas<br />Las vulneravilidades que se podrian presentar es que el acceso a la base de datos no sea controlada a tiempo y que datos muy importantes como informacion de estudiante y tutores esten disponible para todo tipo de usuario, llegando a la conclucion de que los datos puedes ser robados o modificados.<br />