Initial commit

parents
package bootcamp;
interface formas {
public boolean cuadrarTexto();
}
class circulos implements formas {
private int radio;
private String color_cir;
private String palabrac;
public circulos (int radio,String color_cir,String palabrac) {
this.radio=radio;
this.color_cir = color_cir;
this.palabrac=palabrac;
}
public boolean cuadrarTexto(){
if (radio>=palabrac.length() ){
return true;
}else{
return false;
}
}
}
class rectangulos implements formas {
private double longitud;
private double anchura;
private String color_rec;
private String palabrar;
public rectangulos(double longitud, double anchura, String color_rec, String palabrar) {
this.longitud = longitud;
this.anchura = anchura;
this.color_rec = color_rec;
this.palabrar = palabrar;
}
public boolean cuadrarTexto(){
if (longitud>=palabrar.length() ){
return true;
}else{
return false;
}
}
}
public class EjericicioInterface {
public static void main(String [ ] args){
circulos cir = new circulos(5,"Rojo","Paraguay") ;
System.out.println("Es mayor las letras que el radio en el circulo?"+cir.cuadrarTexto());
rectangulos rec = new rectangulos (10,8,"verder","Java");
System.out.println("Es mayor la longitud que la dimension de la palabra? "+rec.cuadrarTexto());
}
}
//1
select customer.first_name from customer
join rental on customer.customer_id=rental.customer_id
where customer.customer_id=rental.customer_id;
//2
select customer.first_name,film.title from customer
join rental on customer.customer_id=rental.customer_id
join payment on payment.rental_id=rental.rental_id
join inventory on rental.inventory_id=inventory.inventory_id
join film on inventory.film_id=film.film_id
where customer.customer_id=rental.customer_id and rental.rental_id=payment.rental_id
and rental.return_date<payment.payment_date;
//3
select category.name , Count(rental.rental_id) from rental
join inventory on rental.inventory_id=inventory.inventory_id
join film on inventory.film_id=film.film_id
join film_category on film_category.film_id=film.film_id
join category on category.category_id=film_category.category_id
Group by category.name
order by Count(rental.rental_id) desc;
//4
select cu.first_name,cu.customer_id , category.name , Count(rental.rental_id) from rental
join inventory on rental.inventory_id=inventory.inventory_id
join film on inventory.film_id=film.film_id
join film_category on film_category.film_id=film.film_id
join category on category.category_id=film_category.category_id
join customer cu on cu.customer_id=rental.customer_id
Group by category.name,cu.customer_id
order by Count(rental.rental_id) desc;
//5
Select lan.name,count(lan.language_id) from rental ren
join inventory inv on inv.inventory_id=ren.inventory_id
join film fi on inv.film_id=fi.film_id
join language lan on lan.language_id=fi.language_id
group by lan.name;
//6
select st.first_name, count(r.rental_id) from staff st
join payment pay on st.staff_id=pay.staff_id
join rental r on r.rental_id=pay.rental_id
group by st.first_name
order by count(r.rental_id) desc;
//7
select ac.actor_id,ac.first_name,count(rental_id) from actor ac
join film_actor fa on fa.actor_id=ac.actor_id
join film f on f.film_id=fa.film_id
join inventory inv on inv.film_id=f.film_id
join rental r on r.inventory_id=inv.inventory_id
group by ac.first_name,ac.actor_id
order by count(r.rental_id) desc;
//8
select cu.first_name,count(rental_id) from customer cu
join rental r on cu.customer_id=r.customer_id
group by cu.first_name
order by count(r.rental_id) desc;
\ 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