Commit 01e6a576 by willgonzz

Initial commit

parents
/*● 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calculadora</title>
<link href="css/cal.css" rel="stylesheet"/>
<script src="calculadora.js"></script>
</head>
<body>
<table>
<tr>
<td colspan="4"><button id="result"></button></td>
</tr>
<tr>
<td><button onclick="agg('7')">7</button></td>
<td><button onclick="agg('8')">8</button></td>
<td><button onclick="agg('9')">9</button></td>
<td><button onclick="agg('-')">-</button></td>
</tr>
<tr>
<td><button onclick="agg('4')">4</button></td>
<td><button onclick="agg('5')">5</button></td>
<td><button onclick="agg('6')">6</button></td>
<td><button onclick="agg('+')">+</button></td>
</tr>
<tr>
<td><button onclick="agg('1')">1</button></td>
<td><button onclick="agg('2')">2</button></td>
<td><button onclick="agg('3')">3</button></td>
<td><button onclick="agg('/')">/</button></td>
</tr>
<tr>
<td><button onclick="agg('00')">00</button></td>
<td><button onclick="agg('0')">0</button></td>
<td><button onclick="agg('.')">.</button></td>
<td><button onclick="agg('*')">x</button></td>
</tr>
<tr>
<td colspan="3"><button onclick="limpiar()">limpiar</button></td>
<td><button onclick="calc()">=</button></td>
</tr>
</table>
</body>
</html>
\ No newline at end of file
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
table {
width: 60%;
}
button {
color: cornflowerblue;
width: 100%;
font-size: 120%;
}
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
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
import java.util.logging.LogManager;
public interface FormasInterface{
public boolean cartelesRectangulo(String texto);
public boolean cartelesCirculos(String texto);
}
\ No newline at end of file
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment