# Capgemini ADAPT 2022 – Toy Rental Learning Outcome 5 Solutions – RDBMS Solutions 2022

The problems of  Toy Rental LO 5 are – Rental Details of John, Toys Availability, Rental Details of Given Toy, Rented in Bangalore, Customer and Rented Electronic Toys, Not Rented by Customers.

In this post, you will get the solution to the Capgemini ADAPT 2022 solutions to the problems of Toy Rental A Learning Outcome 5.

Note: The solutions are provided for learning purposes only.

## Toy Rental A – SQL Problem Solutions – Learning Outcome 5:

### 1. Rental Details of John:

alter session set current_schema = mt_toy;

SELECT * FROM TOY_RENTAL
WHERE CUSTOMER_ID IN
(SELECT CUSTOMER_ID FROM CUSTOMER
WHERE CUSTOMER_NAME = ‘John’);

### 2. Toys Availability:

alter session set current_schema = mt_toy;

SELECT TOY_ID, TOY_NAME FROM TOY
WHERE TOY_ID IN
(SELECT TOY_ID FROM TOY_RENTAL
WHERE STATUS = ‘Rented’
AND TO_CHAR(RENTAL_END_DATE, ‘DD-MON-YYYY’) = ’31-JUL-2020′);

### 3. Rental Details of Given Toy:

alter session set current_schema = mt_toy;

SELECT * FROM TOY_RENTAL
WHERE TOY_ID IN
(SELECT TOY_ID FROM TOY
WHERE TOY_NAME = ‘PlayStix’);

### 4. Rented in Bangalore:

alter session set current_schema = mt_toy;

SELECT TOY_NAME FROM TOY
WHERE TOY_ID IN
(SELECT TOY_ID FROM TOY_RENTAL
WHERE STATUS = ‘Received’ AND CUSTOMER_ID IN
(SELECT CUSTOMER_ID FROM CUSTOMER
WHERE CITY = ‘Bangalore’));

### 5. Customer and Rented Electronic Toys:

alter session set current_schema = mt_toy;

SELECT CUSTOMER.CUSTOMER_ID, CUSTOMER_NAME, CITY
FROM CUSTOMER, TOY_RENTAL, TOY
WHERE CUSTOMER.CUSTOMER_ID = TOY_RENTAL.CUSTOMER_ID
AND TOY_RENTAL.TOY_ID = TOY.TOY_ID AND TOY_TYPE = ‘Electronics’
ORDER BY CUSTOMER.CUSTOMER_ID;

### 6. Not Rented by Customers:

alter session set current_schema = mt_toy;

SELECT TOY_NAME FROM TOY
WHERE NOT EXISTS
(SELECT TOY_ID FROM TOY_RENTAL
WHERE TOY.TOY_ID = TOY_RENTAL.TOY_ID);

## Top Companies + Batchwise Hiring Drive:

 TOP COMPANIES HIRING DRIVE BATCHWISE HIRING DRIVES