SlideShare una empresa de Scribd logo
1 de 3
create database video_club on primary
(
name = video_club_data,
filename= 'c:video_club.mdf',
size= 5mb,
maxsize=10mb,
filegrowth=1mb
)
log on
(
name = video_club_log,
filename= 'c:video_club.ldf',
size= 5mb,
maxsize=10mb,
filegrowth=1mb
)
--HABILITAR LA BASE DE DATOS
use video_club
--CREACION DE TABLA
create table actor
(
cod_actor varchar(10)Primary key,
nom_actor varchar(30),
nac_actor varchar(20),
sexo_actor varchar(1) check (sexo_actor in ('F','M'))
)
create table director
(
cod_director varchar(10) Primary key,
nom_director varchar(30) not null,
nac_director varchar (30)
)
create table pelicula
(
cod_pelicula varchar(10)Primary key,
titulo_pelicula varchar(30)not null,
nac_pelicula varchar (30),
prod_pelicula varchar (30) not null,
fecha_pelicula smalldatetime,
cantidad_ejemplar int,
cod_director varchar(10) Foreign key (cod_director) references director
(cod_director)
)
create table socio
(
cod_socio varchar(10)Primary key,
nom_socio varchar(30),
direc_socio varchar(30),
telf_socio varchar(30),
garante_socio varchar(10) Foreign key (garante_socio) references socio
(cod_socio)
)
create table pelicula_actor
(
cod_peli_actor varchar(10)Primary key,
cod_pelicula varchar(10) Foreign key (cod_pelicula) references pelicula
(cod_pelicula),
cod_actor varchar(10) Foreign key (cod_actor) references actor (cod_actor),
Rol varchar (30)
)
create table ejemplar
(
cod_ejemplar varchar(10)Primary key,
numero_ejemplar varchar(15),
estado_ejemplar varchar(20),
cod_pelicula varchar(10)Foreign key (cod_pelicula) references pelicula
(cod_pelicula)
)
create table alquiler
(
cod_alquiler varchar(10)Primary key,
fecha_inicio smalldatetime,
fecha_entrega smalldatetime,
cod_socio varchar(10) Foreign key (cod_socio) references socio (cod_socio),
cod_ejemplar varchar(10) Foreign key (cod_ejemplar) references ejemplar
(cod_ejemplar),
precio float
)
--ESTABLECER AUTORIZACION
alter authorization on database::video_club to sa
insert into actor values('1234567892','Luis Marin','Ecuatoriana','M')
insert into actor values('1234561237','Mario Lopez','Colombiana','M')
insert into actor values('3216549875','karen Garcia','Venezolana','F')
insert into actor values('0704400993','Antonio Sevilla','Peruana','M')
insert into actor values('1234567592','Fernanda Reyes','Mexicana','F')
insert into director values('D001','Richard Cujilan','Cubano')
insert into director values('D002','Ruth Cujilan','Ecuatoriana')
insert into director values('D003','Fanny Arias','Venezolana')
insert into director values('D004','Mayra Jaramillo','Mexicano')
insert into director values('D005','Cesar Cujilan','Español')
insert into pelicula values('P001','LOS CROODS','Ecuatoriana','Universal
Studio','11/09/2000',600,'D001')
insert into pelicula values('P002','EL CUERVO','Colombiana','Walt
Disney','04/06/2010',250,'D003')
insert into pelicula values('P003','HOTEL TRANSILVANIA
2','Española','Pixar','09/07/2015',450,'D004')
insert into pelicula values('P004','BIG HERO 6','Mexicana','Plan B
Entertainment','01/08/2003',300,'D005')
insert into pelicula values('P005','ECLIPSE','Brazileña','Hollywood
Picture','29/04/2006',510,'D001')
insert into ejemplar values('E001','150','Bueno','P003')
insert into ejemplar values('E002','300','Terminado','P003')
insert into ejemplar values('E003','240','Extraviado','P003')
insert into ejemplar values('E004','10','Malo','P003')
insert into ejemplar values('E005','364','Proceso','P003')
insert into socio values('S001','Alan Franco','Rocafuerte','2912649','S001')
insert into socio values('S002','Steven Mendez','Garcia
Moreno','2916875','S003')
insert into socio values('S003','Omar Chaparro','Nuve de
Octubre','2917525','S004')
insert into socio values('S004','Galilea Montijo','Quito','2914747','S001')
insert into socio values('S005','Gael Garcia','Guasmo','2925654','S002')
insert into alquiler
values('A001','16/08/2015','20/08/2015','S003','E005',25.00)
insert into alquiler
values('A002','26/09/2015','30/09/2015','S001','E002',15.00)
insert into alquiler
values('A003','24/10/2015','29/10/2015','S005','E001',12.00)
insert into alquiler
values('A004','15/09/2015','20/09/2015','S004','E004',13.00)
insert into alquiler
values('A005','22/07/2015','27/07/2015','S002','E003',20.00)
insert into alquiler
values('A006','15/12/2015','16/12/2015','S004','E002',10.00)
insert into alquiler
values('A007','16/12/2015','17/12/2015','S004','E003',20.00)
insert into pelicula_actor values('PA001','P001','1234567892','Principal')
insert into pelicula_actor values('PA002','P002','0704400993','Secundario')
insert into pelicula_actor values('PA003','P003','3216549875','Principal')
insert into pelicula_actor values('PA004','P004','1234567592','Secundario')
insert into pelicula_actor values('PA005','P005','1234561237','Secundario')
insert into pelicula_actor values('PA006','P006','0704400993','Principal')
insert into pelicula_actor values('PA007','P007','1234567592','Secundario')
insert into pelicula_actor values('PA008','P008','1234567892','Principal')
insert into pelicula_actor values('PA009','P009','1234561237','Secundario')
insert into pelicula_actor values('PA010','P010','3216549875','Secundario')
--consultas
select cod_actor, nom_actor from actor
select * from actor
select * from actor where sexo_actor='M'
select * from actor where sexo_actor='F'
select *from actor where nac_actor='Ecuatoriana'
--MUESTRA EL NUMERO DE EJEMPLARES EN ESTADO MALO
select * from ejemplar where estado_ejemplar='Malo'
--MOSTRAR LAS PELICULAS QUE SE ALQUILARON EN EL MES DE DICIEMBRE DEL 2015
select * from alquiler where fecha_inicio>'01/12/2015' and
fecha_inicio<'31/12/2015'
select * from alquiler
--INSERTAR 2 REGISTROS MAS A LA TABLA ALQUILER
insert into alquiler values
('A008','20/12/2015','22/12/2015','S003','E001',10.00)
insert into alquiler values
('A009','23/12/2015','25/12/2015','S003','E002',10.00)
--ELIMINAR UNA PELICULA
delete from pelicula where cod_pelicula='P003'
select * from pelicula
--ACTORES PRINCIPALES CONSULTA DE DOS TABLAS
select pelicula_actor.cod_actor, actor.nom_actor, pelicula_actor.Rol
from pelicula_actor , actor
where pelicula_actor.cod_actor = actor.cod_actor and
Rol='principal'
-- ACTORES Y DIRECTORES
select pelicula.titulo_pelicula, actor.nom_actor, director.nom_director
from pelicula , actor , director , pelicula_actor
where pelicula_actor .cod_actor= actor.cod_actor and
pelicula_actor .cod_pelicula = pelicula.cod_pelicula and
pelicula.cod_director= director.cod_director
order by pelicula.titulo_pelicula

Más contenido relacionado

La actualidad más candente

The Ring programming language version 1.6 book - Part 61 of 189
The Ring programming language version 1.6 book - Part 61 of 189The Ring programming language version 1.6 book - Part 61 of 189
The Ring programming language version 1.6 book - Part 61 of 189Mahmoud Samir Fayed
 
The Ring programming language version 1.5 book - Part 9 of 31
The Ring programming language version 1.5 book - Part 9 of 31The Ring programming language version 1.5 book - Part 9 of 31
The Ring programming language version 1.5 book - Part 9 of 31Mahmoud Samir Fayed
 
Yapc Asia 2008 TMTOWTMS
Yapc Asia 2008 TMTOWTMSYapc Asia 2008 TMTOWTMS
Yapc Asia 2008 TMTOWTMSJeen Lee
 
The Conscientious Objector Issue #1
The Conscientious Objector Issue #1The Conscientious Objector Issue #1
The Conscientious Objector Issue #1mrmennonite
 
CS50 Lecture2
CS50 Lecture2CS50 Lecture2
CS50 Lecture2昀 李
 
(Manuel procedures programme_transversal_ar)
(Manuel procedures programme_transversal_ar)(Manuel procedures programme_transversal_ar)
(Manuel procedures programme_transversal_ar)Lamiss Violoniste
 
1st Round Athletics Deck (1)
1st Round Athletics Deck (1)1st Round Athletics Deck (1)
1st Round Athletics Deck (1)Sterling Brewster
 
CS50 Lecture1
CS50 Lecture1CS50 Lecture1
CS50 Lecture1昀 李
 
The Ring programming language version 1.4.1 book - Part 15 of 31
The Ring programming language version 1.4.1 book - Part 15 of 31The Ring programming language version 1.4.1 book - Part 15 of 31
The Ring programming language version 1.4.1 book - Part 15 of 31Mahmoud Samir Fayed
 
Amazing display of talent
Amazing display of talentAmazing display of talent
Amazing display of talentRodrigo Manueco
 
Python Developer's Daily Routine
Python Developer's Daily RoutinePython Developer's Daily Routine
Python Developer's Daily RoutineMaxim Avanov
 

La actualidad más candente (15)

EUnit in Practice(Japanese)
EUnit in Practice(Japanese)EUnit in Practice(Japanese)
EUnit in Practice(Japanese)
 
The Ring programming language version 1.6 book - Part 61 of 189
The Ring programming language version 1.6 book - Part 61 of 189The Ring programming language version 1.6 book - Part 61 of 189
The Ring programming language version 1.6 book - Part 61 of 189
 
The Ring programming language version 1.5 book - Part 9 of 31
The Ring programming language version 1.5 book - Part 9 of 31The Ring programming language version 1.5 book - Part 9 of 31
The Ring programming language version 1.5 book - Part 9 of 31
 
Yapc Asia 2008 TMTOWTMS
Yapc Asia 2008 TMTOWTMSYapc Asia 2008 TMTOWTMS
Yapc Asia 2008 TMTOWTMS
 
The Conscientious Objector Issue #1
The Conscientious Objector Issue #1The Conscientious Objector Issue #1
The Conscientious Objector Issue #1
 
CS50 Lecture2
CS50 Lecture2CS50 Lecture2
CS50 Lecture2
 
(Manuel procedures programme_transversal_ar)
(Manuel procedures programme_transversal_ar)(Manuel procedures programme_transversal_ar)
(Manuel procedures programme_transversal_ar)
 
1st Round Athletics Deck (1)
1st Round Athletics Deck (1)1st Round Athletics Deck (1)
1st Round Athletics Deck (1)
 
05 1 수식과 연산자
05 1 수식과 연산자05 1 수식과 연산자
05 1 수식과 연산자
 
CS50 Lecture1
CS50 Lecture1CS50 Lecture1
CS50 Lecture1
 
Taler De Refuerz1
Taler De Refuerz1Taler De Refuerz1
Taler De Refuerz1
 
The Ring programming language version 1.4.1 book - Part 15 of 31
The Ring programming language version 1.4.1 book - Part 15 of 31The Ring programming language version 1.4.1 book - Part 15 of 31
The Ring programming language version 1.4.1 book - Part 15 of 31
 
Casa
CasaCasa
Casa
 
Amazing display of talent
Amazing display of talentAmazing display of talent
Amazing display of talent
 
Python Developer's Daily Routine
Python Developer's Daily RoutinePython Developer's Daily Routine
Python Developer's Daily Routine
 

Destacado

2015 Dec - Int'l Map and Stats
2015 Dec - Int'l Map and Stats2015 Dec - Int'l Map and Stats
2015 Dec - Int'l Map and StatsJamie Hanson
 
fall 2016 resume mk II
fall 2016 resume mk IIfall 2016 resume mk II
fall 2016 resume mk IISteven Davis
 
layering-protocol-verif
layering-protocol-veriflayering-protocol-verif
layering-protocol-verifRavindra Ganti
 
Image processing detect faces( معالجة الصور (كشف الأوجه)
Image processing detect faces( معالجة الصور (كشف الأوجه)Image processing detect faces( معالجة الصور (كشف الأوجه)
Image processing detect faces( معالجة الصور (كشف الأوجه)nabeelasd
 
PGBM01 - MBA Financial Management And Control (2015-16 Trm1 A) Lecture 7 bu...
PGBM01 - MBA Financial Management And Control (2015-16 Trm1 A) Lecture 7   bu...PGBM01 - MBA Financial Management And Control (2015-16 Trm1 A) Lecture 7   bu...
PGBM01 - MBA Financial Management And Control (2015-16 Trm1 A) Lecture 7 bu...Aquamarine Emerald
 
درس في السّيرة النبويّة (27) | الشيخ وائل عبلا
درس في السّيرة النبويّة (27) | الشيخ وائل عبلادرس في السّيرة النبويّة (27) | الشيخ وائل عبلا
درس في السّيرة النبويّة (27) | الشيخ وائل عبلاAmine Mosque
 
OVERVIEW ON THE SEVEN LAYERs OF COMPUTER NETWORK
OVERVIEW ON THE SEVEN LAYERs OF COMPUTER NETWORKOVERVIEW ON THE SEVEN LAYERs OF COMPUTER NETWORK
OVERVIEW ON THE SEVEN LAYERs OF COMPUTER NETWORKwaqasahmad1995
 

Destacado (13)

2015 Dec - Int'l Map and Stats
2015 Dec - Int'l Map and Stats2015 Dec - Int'l Map and Stats
2015 Dec - Int'l Map and Stats
 
Paul verlaine
Paul verlainePaul verlaine
Paul verlaine
 
Early Warning
Early WarningEarly Warning
Early Warning
 
fall 2016 resume mk II
fall 2016 resume mk IIfall 2016 resume mk II
fall 2016 resume mk II
 
Ingles 2
Ingles 2Ingles 2
Ingles 2
 
Cover_Letter
Cover_LetterCover_Letter
Cover_Letter
 
layering-protocol-verif
layering-protocol-veriflayering-protocol-verif
layering-protocol-verif
 
Image processing detect faces( معالجة الصور (كشف الأوجه)
Image processing detect faces( معالجة الصور (كشف الأوجه)Image processing detect faces( معالجة الصور (كشف الأوجه)
Image processing detect faces( معالجة الصور (كشف الأوجه)
 
PGBM01 - MBA Financial Management And Control (2015-16 Trm1 A) Lecture 7 bu...
PGBM01 - MBA Financial Management And Control (2015-16 Trm1 A) Lecture 7   bu...PGBM01 - MBA Financial Management And Control (2015-16 Trm1 A) Lecture 7   bu...
PGBM01 - MBA Financial Management And Control (2015-16 Trm1 A) Lecture 7 bu...
 
درس في السّيرة النبويّة (27) | الشيخ وائل عبلا
درس في السّيرة النبويّة (27) | الشيخ وائل عبلادرس في السّيرة النبويّة (27) | الشيخ وائل عبلا
درس في السّيرة النبويّة (27) | الشيخ وائل عبلا
 
Analytical balance Presentation
Analytical balance PresentationAnalytical balance Presentation
Analytical balance Presentation
 
OVERVIEW ON THE SEVEN LAYERs OF COMPUTER NETWORK
OVERVIEW ON THE SEVEN LAYERs OF COMPUTER NETWORKOVERVIEW ON THE SEVEN LAYERs OF COMPUTER NETWORK
OVERVIEW ON THE SEVEN LAYERs OF COMPUTER NETWORK
 
Le corbusier (1)
Le corbusier (1)Le corbusier (1)
Le corbusier (1)
 

Similar a Video club consulta

sanya's Bug database
sanya's Bug databasesanya's Bug database
sanya's Bug databasesanyabhasin18
 
Script de creación de la base de datos pedidos en MS Access
Script de creación de la base de datos pedidos en MS AccessScript de creación de la base de datos pedidos en MS Access
Script de creación de la base de datos pedidos en MS AccessZantiago Thrash
 
- Php myadmin sql dump-- version 4.0.10.7-- httpwww.php
 - Php myadmin sql dump-- version 4.0.10.7-- httpwww.php - Php myadmin sql dump-- version 4.0.10.7-- httpwww.php
- Php myadmin sql dump-- version 4.0.10.7-- httpwww.phpssuserfa5723
 
Scott sql script as per exercise1
Scott sql script as per exercise1Scott sql script as per exercise1
Scott sql script as per exercise1AjayMaheshwari17
 
Tablas, Codigos Base De Datos Excelsa
Tablas, Codigos Base De Datos ExcelsaTablas, Codigos Base De Datos Excelsa
Tablas, Codigos Base De Datos ExcelsaHéctor
 
Sql (Introduction to Structured Query language)
Sql (Introduction to Structured Query language)Sql (Introduction to Structured Query language)
Sql (Introduction to Structured Query language)Mohd Tousif
 
DROP TABLE ordline ;Drop TABLE OrderTBL ;DROP TABLE Customer.docx
DROP TABLE ordline ;Drop TABLE OrderTBL ;DROP TABLE Customer.docxDROP TABLE ordline ;Drop TABLE OrderTBL ;DROP TABLE Customer.docx
DROP TABLE ordline ;Drop TABLE OrderTBL ;DROP TABLE Customer.docxjacksnathalie
 
Oracle helpdesk database shema
Oracle helpdesk database shemaOracle helpdesk database shema
Oracle helpdesk database shemaMurat Gülci
 
On SQL Managment studioThis lab is all about database normalizatio.pdf
On SQL Managment studioThis lab is all about database normalizatio.pdfOn SQL Managment studioThis lab is all about database normalizatio.pdf
On SQL Managment studioThis lab is all about database normalizatio.pdfinfomalad
 
-- script to create NORTHWOODS database-- revised 8172002 JM .docx
-- script to create NORTHWOODS database-- revised 8172002 JM .docx-- script to create NORTHWOODS database-- revised 8172002 JM .docx
-- script to create NORTHWOODS database-- revised 8172002 JM .docxhoney725342
 
Ifgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdf
Ifgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdfIfgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdf
Ifgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdffazilfootsteps
 

Similar a Video club consulta (14)

sanya's Bug database
sanya's Bug databasesanya's Bug database
sanya's Bug database
 
Script de creación de la base de datos pedidos en MS Access
Script de creación de la base de datos pedidos en MS AccessScript de creación de la base de datos pedidos en MS Access
Script de creación de la base de datos pedidos en MS Access
 
- Php myadmin sql dump-- version 4.0.10.7-- httpwww.php
 - Php myadmin sql dump-- version 4.0.10.7-- httpwww.php - Php myadmin sql dump-- version 4.0.10.7-- httpwww.php
- Php myadmin sql dump-- version 4.0.10.7-- httpwww.php
 
Scott sql script as per exercise1
Scott sql script as per exercise1Scott sql script as per exercise1
Scott sql script as per exercise1
 
Tablas, Codigos Base De Datos Excelsa
Tablas, Codigos Base De Datos ExcelsaTablas, Codigos Base De Datos Excelsa
Tablas, Codigos Base De Datos Excelsa
 
Sql (Introduction to Structured Query language)
Sql (Introduction to Structured Query language)Sql (Introduction to Structured Query language)
Sql (Introduction to Structured Query language)
 
DROP TABLE ordline ;Drop TABLE OrderTBL ;DROP TABLE Customer.docx
DROP TABLE ordline ;Drop TABLE OrderTBL ;DROP TABLE Customer.docxDROP TABLE ordline ;Drop TABLE OrderTBL ;DROP TABLE Customer.docx
DROP TABLE ordline ;Drop TABLE OrderTBL ;DROP TABLE Customer.docx
 
Oracle helpdesk database shema
Oracle helpdesk database shemaOracle helpdesk database shema
Oracle helpdesk database shema
 
On SQL Managment studioThis lab is all about database normalizatio.pdf
On SQL Managment studioThis lab is all about database normalizatio.pdfOn SQL Managment studioThis lab is all about database normalizatio.pdf
On SQL Managment studioThis lab is all about database normalizatio.pdf
 
TDDBC お題
TDDBC お題TDDBC お題
TDDBC お題
 
-- script to create NORTHWOODS database-- revised 8172002 JM .docx
-- script to create NORTHWOODS database-- revised 8172002 JM .docx-- script to create NORTHWOODS database-- revised 8172002 JM .docx
-- script to create NORTHWOODS database-- revised 8172002 JM .docx
 
Graphical representation of Stack
Graphical representation of StackGraphical representation of Stack
Graphical representation of Stack
 
Ifgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdf
Ifgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdfIfgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdf
Ifgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdf
 
Base de datos horario sirena
Base de datos horario sirenaBase de datos horario sirena
Base de datos horario sirena
 

Último

How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 

Último (20)

How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

Video club consulta

  • 1. create database video_club on primary ( name = video_club_data, filename= 'c:video_club.mdf', size= 5mb, maxsize=10mb, filegrowth=1mb ) log on ( name = video_club_log, filename= 'c:video_club.ldf', size= 5mb, maxsize=10mb, filegrowth=1mb ) --HABILITAR LA BASE DE DATOS use video_club --CREACION DE TABLA create table actor ( cod_actor varchar(10)Primary key, nom_actor varchar(30), nac_actor varchar(20), sexo_actor varchar(1) check (sexo_actor in ('F','M')) ) create table director ( cod_director varchar(10) Primary key, nom_director varchar(30) not null, nac_director varchar (30) ) create table pelicula ( cod_pelicula varchar(10)Primary key, titulo_pelicula varchar(30)not null, nac_pelicula varchar (30), prod_pelicula varchar (30) not null, fecha_pelicula smalldatetime, cantidad_ejemplar int, cod_director varchar(10) Foreign key (cod_director) references director (cod_director) ) create table socio ( cod_socio varchar(10)Primary key, nom_socio varchar(30), direc_socio varchar(30), telf_socio varchar(30), garante_socio varchar(10) Foreign key (garante_socio) references socio (cod_socio) ) create table pelicula_actor ( cod_peli_actor varchar(10)Primary key, cod_pelicula varchar(10) Foreign key (cod_pelicula) references pelicula (cod_pelicula), cod_actor varchar(10) Foreign key (cod_actor) references actor (cod_actor), Rol varchar (30) ) create table ejemplar ( cod_ejemplar varchar(10)Primary key, numero_ejemplar varchar(15),
  • 2. estado_ejemplar varchar(20), cod_pelicula varchar(10)Foreign key (cod_pelicula) references pelicula (cod_pelicula) ) create table alquiler ( cod_alquiler varchar(10)Primary key, fecha_inicio smalldatetime, fecha_entrega smalldatetime, cod_socio varchar(10) Foreign key (cod_socio) references socio (cod_socio), cod_ejemplar varchar(10) Foreign key (cod_ejemplar) references ejemplar (cod_ejemplar), precio float ) --ESTABLECER AUTORIZACION alter authorization on database::video_club to sa insert into actor values('1234567892','Luis Marin','Ecuatoriana','M') insert into actor values('1234561237','Mario Lopez','Colombiana','M') insert into actor values('3216549875','karen Garcia','Venezolana','F') insert into actor values('0704400993','Antonio Sevilla','Peruana','M') insert into actor values('1234567592','Fernanda Reyes','Mexicana','F') insert into director values('D001','Richard Cujilan','Cubano') insert into director values('D002','Ruth Cujilan','Ecuatoriana') insert into director values('D003','Fanny Arias','Venezolana') insert into director values('D004','Mayra Jaramillo','Mexicano') insert into director values('D005','Cesar Cujilan','Español') insert into pelicula values('P001','LOS CROODS','Ecuatoriana','Universal Studio','11/09/2000',600,'D001') insert into pelicula values('P002','EL CUERVO','Colombiana','Walt Disney','04/06/2010',250,'D003') insert into pelicula values('P003','HOTEL TRANSILVANIA 2','Española','Pixar','09/07/2015',450,'D004') insert into pelicula values('P004','BIG HERO 6','Mexicana','Plan B Entertainment','01/08/2003',300,'D005') insert into pelicula values('P005','ECLIPSE','Brazileña','Hollywood Picture','29/04/2006',510,'D001') insert into ejemplar values('E001','150','Bueno','P003') insert into ejemplar values('E002','300','Terminado','P003') insert into ejemplar values('E003','240','Extraviado','P003') insert into ejemplar values('E004','10','Malo','P003') insert into ejemplar values('E005','364','Proceso','P003') insert into socio values('S001','Alan Franco','Rocafuerte','2912649','S001') insert into socio values('S002','Steven Mendez','Garcia Moreno','2916875','S003') insert into socio values('S003','Omar Chaparro','Nuve de Octubre','2917525','S004') insert into socio values('S004','Galilea Montijo','Quito','2914747','S001') insert into socio values('S005','Gael Garcia','Guasmo','2925654','S002') insert into alquiler values('A001','16/08/2015','20/08/2015','S003','E005',25.00) insert into alquiler values('A002','26/09/2015','30/09/2015','S001','E002',15.00) insert into alquiler values('A003','24/10/2015','29/10/2015','S005','E001',12.00) insert into alquiler values('A004','15/09/2015','20/09/2015','S004','E004',13.00) insert into alquiler values('A005','22/07/2015','27/07/2015','S002','E003',20.00)
  • 3. insert into alquiler values('A006','15/12/2015','16/12/2015','S004','E002',10.00) insert into alquiler values('A007','16/12/2015','17/12/2015','S004','E003',20.00) insert into pelicula_actor values('PA001','P001','1234567892','Principal') insert into pelicula_actor values('PA002','P002','0704400993','Secundario') insert into pelicula_actor values('PA003','P003','3216549875','Principal') insert into pelicula_actor values('PA004','P004','1234567592','Secundario') insert into pelicula_actor values('PA005','P005','1234561237','Secundario') insert into pelicula_actor values('PA006','P006','0704400993','Principal') insert into pelicula_actor values('PA007','P007','1234567592','Secundario') insert into pelicula_actor values('PA008','P008','1234567892','Principal') insert into pelicula_actor values('PA009','P009','1234561237','Secundario') insert into pelicula_actor values('PA010','P010','3216549875','Secundario') --consultas select cod_actor, nom_actor from actor select * from actor select * from actor where sexo_actor='M' select * from actor where sexo_actor='F' select *from actor where nac_actor='Ecuatoriana' --MUESTRA EL NUMERO DE EJEMPLARES EN ESTADO MALO select * from ejemplar where estado_ejemplar='Malo' --MOSTRAR LAS PELICULAS QUE SE ALQUILARON EN EL MES DE DICIEMBRE DEL 2015 select * from alquiler where fecha_inicio>'01/12/2015' and fecha_inicio<'31/12/2015' select * from alquiler --INSERTAR 2 REGISTROS MAS A LA TABLA ALQUILER insert into alquiler values ('A008','20/12/2015','22/12/2015','S003','E001',10.00) insert into alquiler values ('A009','23/12/2015','25/12/2015','S003','E002',10.00) --ELIMINAR UNA PELICULA delete from pelicula where cod_pelicula='P003' select * from pelicula --ACTORES PRINCIPALES CONSULTA DE DOS TABLAS select pelicula_actor.cod_actor, actor.nom_actor, pelicula_actor.Rol from pelicula_actor , actor where pelicula_actor.cod_actor = actor.cod_actor and Rol='principal' -- ACTORES Y DIRECTORES select pelicula.titulo_pelicula, actor.nom_actor, director.nom_director from pelicula , actor , director , pelicula_actor where pelicula_actor .cod_actor= actor.cod_actor and pelicula_actor .cod_pelicula = pelicula.cod_pelicula and pelicula.cod_director= director.cod_director order by pelicula.titulo_pelicula