Capgemini ADAPT 2022 Sprint 3 Book Rental A Solutions to Learning Outcome 3

Capgemini ADAPT 2022 Sprint 3 Book Rental A Solutions to Learning Outcome 3
Capgemini ADAPT 2022 Sprint 3 Book Rental A Solutions to Learning Outcome 3

In this post, we have tried to provide solutions to the problems of Capgemini ADAPT 2022 Book Rental A (Books Rented on Given Date, Current Month Users Details, User Details of Book Rental, Maximum Book Availed by the User, Books Availed by Most of the Users, Users Rented Neural Networks Book, Book not returned by the User, User & Rental Information, All User’s & Rental Information, Maximum Rent for the Month). These problems are from Capgemini ADAPT Program 2022. We have provided the solutions to the Problems noted below –

  1. BRL3-1 Books Rented on Given Date
  2. BRL3-2 Current Month Users Details
  3. BRL3-3 User Details of Book Rental
  4. BRL3-4 Maximum Book Availed by the User
  5. BRL3-5 Books Availed by Most of the Users
  6. BRL3-6 Users Rented Neural Networks Book
  7. BRL3-7 Book not returned by the User
  8. BRL3-8 User & Rental Information
  9. BRL3-9 All User’s & Rental Information
  10. BRL3-10 Maximum Rent for the Month

Note: The solutions are provided for your reference only. During the assessment, you are requested to not use any malpractices, rather than solve all the problems on your own. We do not encourage candidates to fall into any malpractice.

Book Rental A Problem Solutions:

1.BRL3-1 Books Rented on Given Date Problem Solution:


Display the books which were rented out on 20/11/2020

Solution:

alter session set current_schema = bookrental;

SET heading OFF

SELECT *

FROM book

WHERE book_id in (SELECT book_id

FROM book_rental

WHERE to_char(rental_start_date, ‘DD-MM-YYYY’) = ’20-11-2020′);

2. BRL3-2 Current Month Users Details Problem Solution:


List the users who have availed of the books a current month.

Solution:

alter session set current_schema = bookrental;

SET heading OFF

SELECT *

FROM user_details

WHERE user_id in (SELECT user_id

FROM ook_rental

WHERE to_char(rental_start_date, ‘MON’)=’DEC’);

3. BRL3-3 User Details of Book Rental Problem Solution:


Display all the users who have rented at least 1 book with details of the book & rental return date.

Solution:

alter session set current_schema = bookrental;

SET heading OFF

SELECT first_name, title, rental_end_date

FROM user_details a, book_rental b, book c

WHERE a.user_id = b.user_id(+) AND b.book_id = c.book_id;

4. BRL3-4 Maximum Book Availed by the User Problem Solution:


Fetch the first_name of the user who has availed a maximum number of books for rental during the current fiscal.

Solution:

alter session set current_schema = bookrental;

SET heading OFF

SELECT first_name

FROM user_details

WHERE user_id = (SELECT *

FROM (SELECT user_id

FROM book_rental GROUP BY user_id

ORDER BY count(*) desc)

WHERE rownum <= 1);

5. BRL3-5 Books Availed by Most of the Users Problem Solution:


Fetch the book which was availed for rent by most users.

Solution:

alter session set current_schema = bookrental;

SET heading OFF

SELECT * FROM book WHERE

book_id = (SELECT*FROM 

(SELECT book_id 

FROM book_rental

GROUP BY book_id

ORDER BY count(book_id) desc)

WHERE rownum <= 1);

6. BRL3-6 Users Rented Neural Networks Book Problem Solution:


Identify the users who have opted for a book named ‘Neural Networks’.

Solution:

alter session set current_schema = bookrental;

SET heading OFF

SELECT * FROM user_details

WHERE user_id in(

SELECT a.user_id

FROM book_rental a, book b, user_details c

WHERE b.book_id = a.book_id

AND c.user_id = a.user_id

AND b.title = ‘Neural Networks’);

7. BRL3-7 Book not returned by the User Problem Solution:


Fetch the user information who has not returned the books after the rental period.

Solution:

alter session set current_schema = bookrental;

SET heading OFF

SELECT * FROM user_details

WHERE user_id in (SELECT user_id

FROM book_rental

WHERE isreturned = ‘no’ );

8. BRL3-8 User & Rental Information Problem Solution:


Display the user’s first_name, book title, and the rental end date of the book for the rental id/s which was rented on 25th Nov 2020.

Solution:

alter session set current_schema = bookrental;

SET heading OFF

SELECT ud.first_name, bk.title, br.rental_end_date

FROM user_details ud, book bk, book_rental br

WHERE ud.user_id = br.user_id

AND br.book_id = bk.book_id

AND to_char(br.rental_start_date, ‘dd/mm/yy’) = ’25/11/20′;

9. BRL3-9 All User’s & Rental Information


Display all the user’s first name, book title, rental start date, and rental end date for all users with the rental details even if they don’t avail any books for rental and sort the output on first_name.

Solution:

alter session set current_schema = bookrental;

SET heading OFF

SELECT ud.first_name, bk.title, br.rental_start_date, br.rental_end_date

FROM user_details ud, book bk, book_rental br

WHERE ud.user_id = br.user_id(+)

AND br.book_id = bk.book_id(+)

ORDER BY ud.first_name;

10. BRL3-10-Maximum Rent for the Month Problem Solution:


Display first name, city, and total rent amount of the month for the user whose rental amount is maximum for the month.

Solution:

alter session set current_schema = bookrental;

SET heading OFF

SELECT * 

FROM (SELECT first_name, city, SUM(total_amount)

FROM book_rental be, user_details ud

WHERE br.user_id = ud.user_id AND br.rental_start_date like ‘%DEC%’

GROUP BY ud.first_name, ud.city

ORDER BY SUM(total_amount) desc)

WHERE rownum = 1;


BOOK RENTAL A ALL SOLUTIONSCLICK HERE

Top Companies + Batchwise Hiring Drive:


TOP COMPANIES HIRING DRIVEBATCHWISE HIRING DRIVES
1. TCS OFF-CAMPUS DRIVES1. 2018 BATCH
2. INFOSYS OFF-CAMPUS DRIVES2. 2019 BATCH
3. COGNIZANT OFF-CAMPUS DRIVES3. 2020 BATCH
4. WIPRO OFF-CAMPUS DRIVES4. 2021 BATCH
5. CAPGEMINI OFF-CAMPUS DRIVES5. 2022 BATCH

To Stay Up-to-date, Follow us on Social Media:


1.      Join our Telegram Channel:Click Here
2.      Like us on Facebook:Click Here
3.      Follow us on Instagram:Click Here
4.      Follow us on LinkedIn:Click Here
5.      Follow us on Google News: Click Here

ADAPT Different Coding Solutions:


  1. Largest Array Solution – Click Here
  2. Batsman & Bowler Solution – Click Here
  3. Instruments Problem Solution – Click Here
  4. Check Two Person Are Same – Click Here
  5. Medicine App ADAPT Solution – Click Here
  6. String Combination Capgemini ADAPT Solution – Click Here
  7. Remove”X”inString Problem Solution – Click Here
  8. Customer and Invoice ADAPT Problem Solution – Click Here
  9. Book and Author Problem Solution – Click Here
  10. Highest Feedback Problem Solution – Click Here
  11. Registered Customer Problem Solution in Java – Click Here
  12. Product of Digits Problem Solution – Click Here
  13. Change Using Minimal Coins/Notes Solution in Java – Click Here

Capgemini ADAPT Sprint 1 (Bus Reservation Solutions):


  • 1. Capgemini ADAPT Sprint 1 Bus Reservation System – DisplayCustomerInAscendingOrder Problem Solution
  • 2. Capgemini ADAPT Sprint 1 Bus Reservation System – DisplayCustomerByFirstName Problem Solution
  • 3. Capgemini ADAPT Sprint 1 Bus Reservation System – SortByCustomerId Problem Solution
  • 4. Capgemini ADAPT Sprint 1 Solution Java | LSAByCustomerName Problem Solution
  • 5. Capgemini ADAPT Sprint 1 Case Study Solution Java | BSAByCustomerId Problem Solution

Capgemini ADAPT Sprint 2 (Bus Reservation System):


  • 1. Capgemini ADAPT Sprint 2 Case Study (Bus Reservation System) Solution | HAS-A-Relationship Solution Java
  • 2. Capgemini ADAPT Sprint 2 Case Study (Bus Reservation System) Solution OOPs-Para-Constructor Java
  • 3. Capgemini ADAPT Sprint 2 Bus Reservation System (CRUDOperations) Problem Solution

ADAPT Sprint 3 Solutions – Capgemini (Toy Rental A):


Online Shopping A Solutions Using Java:


  • 1. Capgemini ADAPT 2022 Online Shopping A – Display Products Solution using JAVA – Click Here
  • 2. Capgemini ADAPT 2022 Online Shopping A – Products by Category Solution using JAVA – Click Here
  • 3. Capgemini ADAPT 2022 Online Shopping A – Customer Array Solution using JAVA – Click Here
  • 4. Capgemini ADAPT 2022 Online Shopping A – Search Customers by Name Solution using JAVA – Click Here
  • 5. Capgemini ADAPT 2022 Online Shopping A – Search Customers by City Solution using JAVA – Click Here
  • 6. Online Shopping A – Customer & Address Class Solution | Capgemini ADAPT 2022 Solutions – Click Here