SlideShare a Scribd company logo
1 of 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

More Related Content

What's hot

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
 

What's hot (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
 

Similar to 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 to 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
 

Recently uploaded

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
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
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
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
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
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
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
 

Recently uploaded (20)

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
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
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...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
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
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
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
 
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...
 

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