Base de Datos video club
Enviado por katita14 • 9 de Marzo de 2020 • Práctica o problema • 1.695 Palabras (7 Páginas) • 174 Visitas
create database videoclubb;
USE videoclubb;
CREATE TABLE `Socio` (
`id_socio` char(4) NOT NULL ,
`Nombre` varchar(50),
`telefono` varchar(25),
`direccion` varchar(25),
PRIMARY KEY (`id_socio`)
);
INSERT INTO Socio Values('S001','Brandon',9911642,'Penonome');
INSERT INTO Socio Values('S002','Fernando',9972080,'La Pintada');
INSERT INTO Socio Values('S003','Moises',9985050,'Cañaveral');
INSERT INTO Socio Values('S004','Alan',9912020,'Santa Maria');
INSERT INTO Socio Values('S005','Carolina',9921427,'Cope');
INSERT INTO Socio Values('S006','Karla',9911540,'Santa Clara');
INSERT INTO Socio Values('S007','Samuel',9911540,'Anton');
INSERT INTO Socio Values('S008','Camila',993212,'Aguas Blancas');
INSERT INTO Socio Values('S009','Elena',9945055,'El Coco');
INSERT INTO Socio Values('S010','Josefa',9971427,'Cocle');
INSERT INTO Socio Values('S011','Angel',9910403,'Ciruelito');
INSERT INTO Socio Values('S012','Maria',9980505,'Cañaveral');
INSERT INTO Socio Values('S013','Mario',9911720,'Juan Diaz');
INSERT INTO Socio Values('S014','Karina',9922428,'Farrallon');
INSERT INTO Socio Values('S015','Karen',9922400,'Cristo Rey');
INSERT INTO Socio Values('S016','Keneth',9911516,'Churuquita');
INSERT INTO Socio Values('S017','Camilo',9982114,'Caimito');
INSERT INTO Socio Values('S018','Alejandro',9911402,'Barrero');
INSERT INTO Socio Values('S019','Aselen',9973242,'Pajonal');
INSERT INTO Socio Values('S020','Minelys',9911552,'Nata');
SELECT * FROM socio;
CREATE TABLE `Pelicula` (
`id_pelicula` char(4) NOT NULL ,
`Pelicula` varchar(50),
`id_genero` char(4) NOT NULL ,
PRIMARY KEY (`id_pelicula`),
KEY `FK` (`id_genero`)
);
INSERT INTO Pelicula Values('P001','Buscando a Nemo','G001');
INSERT INTO Pelicula Values('P002','Ciudad de Dios','G002');
INSERT INTO Pelicula Values('P003','El Señor de los Anillos','G003');
INSERT INTO Pelicula Values('P004','Crepusculo','G004');
INSERT INTO Pelicula Values('P005','Toy Story','G005');
INSERT INTO Pelicula Values('P006','Terminator2','G001');
INSERT INTO Pelicula Values('P007','Regreso al Futuro','G002');
INSERT INTO Pelicula Values('P008','King Kong','G003');
INSERT INTO Pelicula Values('P009','El Planeta de los Simios','G004');
INSERT INTO Pelicula Values('P010','Spiderman','G005');
INSERT INTO Pelicula Values('P011','Yo antes de ti','G001');
INSERT INTO Pelicula Values('P012','Los Increibles2','G002');
INSERT INTO Pelicula Values('P013','Pantera Negra','G003');
INSERT INTO Pelicula Values('P014','Baby Driver','G004');
INSERT INTO Pelicula Values('P015','Mision Imposible','G005');
INSERT INTO Pelicula Values('P016','Hallowen','G001');
INSERT INTO Pelicula Values('P017','Un lugar en Silencio','G002');
INSERT INTO Pelicula Values('P018','La Monja','G003');
INSERT INTO Pelicula Values('P019','El Conjuro','G004');
INSERT INTO Pelicula Values('P020','Posesion Infernal','G005');
INSERT INTO Pelicula Values('P021','Son Como Niños','G001');
INSERT INTO Pelicula Values('P022','Bad Moms','G002');
INSERT INTO Pelicula Values('P023','La Familia de mi Novia','G003');
INSERT INTO Pelicula Values('P024','Que Paso Ayer','G004');
INSERT INTO Pelicula Values('P025','Sex Pact','G005');
INSERT INTO Pelicula Values('P026','Mision Rescate','G001');
INSERT INTO Pelicula Values('P027','Jurassic World','G002');
INSERT INTO Pelicula Values('P028','Avatar','G003');
INSERT INTO Pelicula Values('P029','Star Trek','G004');
INSERT INTO Pelicula Values('P030','Cars','G005');
INSERT INTO Pelicula Values('P031','Mi Villano Favorito','G001');
INSERT INTO Pelicula Values('P032','Emoji','G002');
INSERT INTO Pelicula Values('P033','Pie Pequeño','G003');
INSERT INTO Pelicula Values('P034','Bajo la Misma Estrella','G004');
INSERT INTO Pelicula Values('P035','Tres Metros Sobre el Cielo','G005');
INSERT INTO Pelicula Values('P036','Diario de una Pasion','G001');
INSERT INTO Pelicula Values('P037','Mujer Maravilla','G002');
INSERT INTO Pelicula Values('P038','Deadpool','G003');
INSERT INTO Pelicula Values('P039','Avengers','G004');
INSERT INTO Pelicula Values('P040','Aquaman','G005');
SELECT * FROM pelicula;
CREATE TABLE `Director` (
`id_director` char(4) NOT NULL ,
`Director` varchar(200),
PRIMARY KEY (`id_director`)
);
INSERT INTO Director Values('D001','Andrew Stanton');
INSERT INTO Director Values('D002','Fernando Meirelles');
INSERT INTO Director
...