You are on page 1of 10

a   



c   c  
  

c   c  
  

c   c  
  

c   c  
  

c   c  
  

c   c  
  

DICCIONARIO DE DATOS
CREATE TABLE PELICULAS (
IDPELICULA NUMBER(5) NOT NULL,
NOMBRE CHAR(20) NOT NULL,
CLASIFICACION CHAR(3) NOT NULL,
GENERO CHAR(20) NOT NULL,
CONSTRAINT "PK_PELICULAS" PRIMARY KEY ("IDPELICULA")
);

CREATE TABLE SALAS (


IDSALA NUMBER (5)NOT NULL,
NOMBRE CHAR(20) NOT NULL,
CAPACIDAD NUMBER(4) NOT NULL,
IDCINE NUMBER (5),
CONSTRAINT "PK_SALAS" PRIMARY KEY ("IDSALA"),
CONSTRAINT "FK_CINE" FOREIGN KEY ("IDCINE")
REFERENCES CINE
);
CREATE TABLE CINE (
IDCINE NUMBER (5) NOT NULL,
NOMBRE CHAR(20) NOT NULL,
UBICACION CHAR(20) NOT NULL,
CIUDAD CHAR(20) NOT NULL,
CONSTRAINT "PK_CINE" PRIMARY KEY ("IDCINE")
);
CREATE TABLE HORARIO (
IDHORARIO NUMBER (5) NOT NULL,
IDSALA NUMBER (5) NOT NULL,
IDPELICULA NUMBER(5) NOT NULL,
HORARIOPELICULA VARCHAR(5),
FECHA DATE,
CONSTRAINT "PK_HORARIO" PRIMARY KEY ("IDHORARIO"),
CONSTRAINT "FK_SALA" FOREIGN KEY ("IDSALA")
REFERENCES SALA
CONSTRAINT "FK_PELICULAS" FOREIGN KEY ("IDPELICULA")
REFERENCES PELICULAS

);

c   c  
  

a 
 
INSERT INTO PELICULAS VALUES (00001,'IRONMAN','B','ACCION');
INSERT INTO PELICULAS VALUES (00002,'IRONMAN2','B','ACCION');
INSERT INTO PELICULAS VALUES (00003,'TRANSPORTADOR','B','ACCION');
INSERT INTO PELICULAS VALUES (00004,'TRANSPORTADOR2','B','ACCION');
INSERT INTO PELICULAS VALUES (00005,'TRANSPORTADOR3','B','ACCION');
INSERT INTO PELICULAS VALUES (00006,'SCARY MOVIE1','B15','COMEDIA');
INSERT INTO PELICULAS VALUES (00007,'SCARY MOVIE2','B15','COMEDIA');
INSERT INTO PELICULAS VALUES (00008,'SCARY MOVIE3','B15','COMEDIA');
INSERT INTO PELICULAS VALUES (00009,'SCARY MOVIE4','B15','COMEDIA');
INSERT INTO PELICULAS VALUES (00011,'SHREK4','A','COMEDIA');
INSERT INTO PELICULAS VALUES (00012,'NOTEBOOK','A','ROMANTICA');
INSERT INTO PELICULAS VALUES (00013,'HARRY POTTER6','A','CIENCIA
FICCION');
INSERT INTO PELICULAS VALUES (00014,'AVATAR','A','CIENCIA FICCION');

  
  
INSERT INTO SALAS VALUES (10001,'1','200','20001');
INSERT INTO SALAS VALUES (10002,'2','200','20001');
INSERT INTO SALAS VALUES (10003,'3','200','20001');
INSERT INTO SALAS VALUES (10004,'4','200','20001');
INSERT INTO SALAS VALUES (10005,'5','200','20001');
INSERT INTO SALAS VALUES (10006,'6','200','20001');
INSERT INTO SALAS VALUES (10007,'7','200','20001');
INSERT INTO SALAS VALUES (10008,'8','200','20001');
INSERT INTO SALAS VALUES (10009,'9','200','20001');
INSERT INTO SALAS VALUES (10010,'10','200','20001');
INSERT INTO SALAS VALUES (10011,'11','200','20001');
INSERT INTO SALAS VALUES (10012,'12','200','20001');
INSERT INTO SALAS VALUES (10013,'13','200','20001');
INSERT INTO SALAS VALUES (10014,'14','200','20001');

  
INSERT INTO SALAS VALUES (10201,'1','200','20002');
INSERT INTO SALAS VALUES (10202,'2','200','20002');

c   c  
  

INSERT INTO SALAS VALUES (10203,'3','200','20002');
INSERT INTO SALAS VALUES (10204,'4','200','20002');
INSERT INTO SALAS VALUES (10205,'5','200','20002');
INSERT INTO SALAS VALUES (10206,'6','200','20002');
INSERT INTO SALAS VALUES (10207,'7','200','20002');
INSERT INTO SALAS VALUES (10208,'8','200','20002');
INSERT INTO SALAS VALUES (10209,'9','200','20002');

 

INSERT INTO CINE VALUES (20001,'CINEPOLIS AMERICAS','BOCA DEL


RIO','VERACRUZ');
INSERT INTO CINE VALUES (20002,'CINEPOLIS
BRISAS','VERACRUZ','VERACRUZ');

 
INSERT INTO HORARIO VALUES (30001,'10001','00001','12:10','02/06/2010');
INSERT INTO HORARIO VALUES (30002,'10001','00001','1:10','02/06/2010');
INSERT INTO HORARIO VALUES (30003,'10001','00001','12:10','02/06/2010');
INSERT INTO HORARIO VALUES (30004,'10001','00001','12:10','02/06/2010');
INSERT INTO HORARIO VALUES (30005,'10001','00001','12:10','02/06/2010');
INSERT INTO HORARIO VALUES (30006,'10001','00001','12:10','02/06/2010');
INSERT INTO HORARIO VALUES (30007,'10001','00001','12:10','02/06/2010');









c   c  
  



 

SELECT NOMBRE,GENERO FROM PELICULAS


ORDER BY GENERO;

SELECT NOMBRE,CIUDAD FROM PELICULAS,CINE


WHERE SALAS.IDSALAS=CINE.IDSALAS AND
PELICULAS.IDPELICULA=SALAS.IDPELICULA AND
PELICULAS.GENERO='COMEDIA';




       




c   c