From 01e6a576dec45ba6830e605602ad7dcc420ce267 Mon Sep 17 00:00:00 2001 From: willgonzz Date: Sun, 24 Oct 2021 10:31:00 -0300 Subject: [PATCH] Initial commit --- Ejercicio BD - SELECT y WHERE/selectwhere.SQL | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ calculadora/calcu.html | 47 +++++++++++++++++++++++++++++++++++++++++++++++ calculadora/calculadora.js | 18 ++++++++++++++++++ calculadora/css/cal.css | 8 ++++++++ interface/Carteles.java | 44 ++++++++++++++++++++++++++++++++++++++++++++ interface/Circulos.java | 17 +++++++++++++++++ interface/FormasInterface.java | 7 +++++++ interface/Rectangulos.java | 18 ++++++++++++++++++ 8 files changed, 212 insertions(+) create mode 100644 Ejercicio BD - SELECT y WHERE/selectwhere.SQL create mode 100644 calculadora/calcu.html create mode 100644 calculadora/calculadora.js create mode 100644 calculadora/css/cal.css create mode 100644 interface/Carteles.java create mode 100644 interface/Circulos.java create mode 100644 interface/FormasInterface.java create mode 100644 interface/Rectangulos.java diff --git a/Ejercicio BD - SELECT y WHERE/selectwhere.SQL b/Ejercicio BD - SELECT y WHERE/selectwhere.SQL new file mode 100644 index 0000000..0c916c1 --- /dev/null +++ b/Ejercicio BD - SELECT y WHERE/selectwhere.SQL @@ -0,0 +1,53 @@ +/*● Consulta todos los clientes que han alquilado películas*/ +SELECT CU.FIRST_NAME +FROM CUSTOMER AS CU +JOIN RENTAL AS REN ON CU.CUSTOMER_ID=REN.CUSTOMER_ID + +/*● Obtenga todos los clientes que hayan vencido la fecha de vencimiento de pago. +Muestra también por qué películas vencen sus pagos.*/ + +SELECT DISTINCT CU.FIRST_NAME +FROM CUSTOMER CU +JOIN RENTAL REN ON REN.CUSTOMER_ID=CU.CUSTOMER_ID +JOIN PAYMENT PAY ON PAY.CUSTOMER_ID=CU.CUSTOMER_ID +WHERE RETURN_DATE<=PAYMENT_DATE; + +/*● ¿Cuáles son las categorías más alquiladas?*/ +SELECT DISTINCT TITLE +FROM FILM +WHERE RENTAL_RATE=(SELECT MAX(RENTAL_RATE) FROM FILM); + +/*Cuales son las categorías más alquiladas agrupadas por cliente*/ +SELECT DISTINCT NAME +FROM CATEGORY CAT +JOIN FILM_CATEGORY FIC ON CAT.CATEGORY_ID=FIC.CATEGORY_ID +JOIN FILM FI ON FI.FILM_ID=FIC.FILM_ID +WHERE RENTAL_RATE=(SELECT MAX(RENTAL_RATE)FROM FILM); + +/*Cual es el lenguaje más alquilado*/ + +SELECT DISTINCT LEN.NAME +FROM LANGUAGE LEN +JOIN FILM FI ON FI.LANGUAGE_ID=LEN.LANGUAGE_ID +WHERE RATING = (SELECT MAX(RATING) FROM FILM); +/*● Cuál empleados son los mejores. Significa cual empleados se alquila maximo películas*/ +SELECT DISTINCT FIRST_NAME +FROM STAFF STA +JOIN RENTAL REN ON REN.STAFF_ID=STA.STAFF_ID +JOIN INVENTORY INV ON INV.INVENTORY_ID=REN.INVENTORY_ID +JOIN FILM FI ON FI.FILM_ID=INV.FILM_ID +WHERE TITLE=(SELECT MAX(TITLE)FROM FILM); + +/*Quién es el actor más famoso. Significa películas de cual actor se alquila maximo*/ +SELECT DISTINCT FIRST_NAME +FROM ACTOR AC +JOIN FILM_ACTOR FAC ON FAC.ACTOR_ID=AC.ACTOR_ID +JOIN FILM FI ON FI.FILM_ID=FAC.FILM_ID +JOIN INVENTORY INV ON FI.FILM_ID=INV.FILM_ID +JOIN RENTAL REN ON REN.INVENTORY_ID=INV.INVENTORY_ID +WHERE TITLE=(SELECT MAX(TITLE)FROM FILM); +/*Quien es el mejor cliente. ¿Significa quien alquila máximo?*/ +SELECT DISTINCT FIRST_NAME +FROM CUSTOMER CUS +JOIN PAYMENT PAY ON PAY.CUSTOMER_ID=CUS.CUSTOMER_ID +WHERE AMOUNT = (SELECT MAX(AMOUNT) FROM PAYMENT); \ No newline at end of file diff --git a/calculadora/calcu.html b/calculadora/calcu.html new file mode 100644 index 0000000..67ea37f --- /dev/null +++ b/calculadora/calcu.html @@ -0,0 +1,47 @@ + + + + + + + Calculadora + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + \ No newline at end of file diff --git a/calculadora/calculadora.js b/calculadora/calculadora.js new file mode 100644 index 0000000..5dda272 --- /dev/null +++ b/calculadora/calculadora.js @@ -0,0 +1,18 @@ +function setResult(value) { + document.getElementById('result').innerHTML = value; +} +function getResult() { + return(document.getElementById('result').innerHTML); +} +function agg(key) { + var result = getResult(); + if (result!='0' || isNaN(key)) setResult(result + key); + else setResult(key); +} +function calc() { + var result = eval(getResult()); + setResult(result); +} +function limpiar() { + setResult(0); +} \ No newline at end of file diff --git a/calculadora/css/cal.css b/calculadora/css/cal.css new file mode 100644 index 0000000..6a76571 --- /dev/null +++ b/calculadora/css/cal.css @@ -0,0 +1,8 @@ +table { + width: 60%; +} +button { + color: cornflowerblue; + width: 100%; + font-size: 120%; +} diff --git a/interface/Carteles.java b/interface/Carteles.java new file mode 100644 index 0000000..6e589a4 --- /dev/null +++ b/interface/Carteles.java @@ -0,0 +1,44 @@ +import java.util.Scanner; +import java.util.Scanner; +public class Carteles implements CartelesInterface{ + String texto; + Carteles(String T){ + texto=t; + } + public static void main(String[] args) { + Scanner scanner=new Scanner(System.in); + System.out.println("Ingrese el texto que desea imprimir en el cartel:"); + String texto=scanner.nextLine(); + System.out.println("Ingrese la forma que desea utilizar para su cartel"); + System.out.println("1-circulo\n2-rectangulo"); + int a=scanner.nextInt(); + if(a==1){ + System.out.println("ingrese el radio:"); + int d=scanner.nextInt(); + System.out.println("ingrese el color:"); + String c=scanner.nextLine(); + Circulos C=new Circulos(d,c); + if(C.cartelesCirculos(texto)){ + System.out.println("el cartel se podra hacer"); + }else{ + System.out.println("el cartel no se podra hacer, el texto excede al radio"); + } + }else{ + System.out.println("Ingrese la anchura:"); + int d=scanner.nextInt(); + System.out.println("Ingrese la altura:"); + int b=scanner.nextInt(); + System.out.println("ingrese el color:"); + String c=scanner.nextLine(); + Rectangulos R=new Rectangulos(d,b,c); + if(R.cartelesRectangulo(texto)){ + System.out.println("el cartel se podra hacer"); + }else{ + System.out.println("el cartel no se podra hacer, el texto excede a la longitud"); + } + } + + + } + +} \ No newline at end of file diff --git a/interface/Circulos.java b/interface/Circulos.java new file mode 100644 index 0000000..e435483 --- /dev/null +++ b/interface/Circulos.java @@ -0,0 +1,17 @@ + +public class Circulos implements FormasInterface{ + float radio; + String color; + final static float pi=3.14f; + public void Circulo(float radio, String color){ + this.radio=radio; + this.color=color; + } + public boolean cartelesCirculos(String texto){ + if(texto.length()>=radio){ + return true; + }else{ + return false; + } + } +} \ No newline at end of file diff --git a/interface/FormasInterface.java b/interface/FormasInterface.java new file mode 100644 index 0000000..a0a8ad9 --- /dev/null +++ b/interface/FormasInterface.java @@ -0,0 +1,7 @@ +import java.util.logging.LogManager; + +public interface FormasInterface{ + public boolean cartelesRectangulo(String texto); + public boolean cartelesCirculos(String texto); + +} \ No newline at end of file diff --git a/interface/Rectangulos.java b/interface/Rectangulos.java new file mode 100644 index 0000000..fd910e9 --- /dev/null +++ b/interface/Rectangulos.java @@ -0,0 +1,18 @@ +public class Rectangulos implements FormasInterface{ + String color; + float longitud; + float anchura; + public void Rectangulos(float longitud, float anchura, float color){ + this.longitud=longitud; + this.anchura=anchura; + this.color=color; + } + public boolean cartelesRectangulo(String texto){ + if(texto.length()>=longitud){ + return true; + }else{ + return false; + } + } + +} \ No newline at end of file -- libgit2 0.26.0