0% found this document useful (0 votes)
9 views

SQL-Assignment-July-2023

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

SQL-Assignment-July-2023

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Problem Statement

In 2009, Mr. Harry Peter, founded a Baby Toy Company LLP, in United States, its headquarters in Los
Angeles, CA. The company was selling premium toys, but the business had been stagnant over the
years. Harry Peter was looking at bringing in new offerings to increase revenue. A survey was
conducted on kids and their preference for toys and it was found that attention span/engagement
with a new toy lasts only few days for kids and they start demanding a new one within a week.
However, the survey also brought out that parents found affording premium toys difficult. Like any
businessman, Harry Peter saw an opportunity here and decided to launch a new offering of premium
toys being available on rent. He directed his IT team to make rental option for customers available
on their online portal

Your company ABC Corp, India has been awarded this project and you are chosen as one of the
developers, to provide solution for the Baby Toy Company LLP.

At a very high level the Business Analyst has captured the attributes of the business shown in Figure
1.0

Figure 1.0
Pre-Start
Foundation
RDBMS Concepts & SQL Using Oracle

Outcome
Topic Name Learning Outcome Business Outcome
• Perform CRUD operations with DBMS, • Identify the most rented toy to get
and know the importance of keeping insights on profitability and stock
the data clean management.
• Understand the basics of RDBMS • Identify the most valued customer
design
• Better predications of rental system
• Understanding the need of critical
data for business
from historical data for future proof
• Normalizing data and specifying • Reports on customer behaviour wrt
RDBMS and proper data type multiple factors like city, price,
SQL • Handling proper constraints inter and season etc.
intra table • Demand of toys by age group, thus
• Organize data in relative table and making good return on investment.
store data in rows and column •
• Maintain data consistency through
appropriate integrity constraints
• Handling DB Objects and indexing
• Generating various types of reports
for the stake holder

Below is the list of requirements captured by a Business Analyst. Requirements are in terms of business
outcome and use cases. Learning outcomes will be the takeaway for you (developer) as you implement
these requirements. You will be graded on the learning outcomes that you will achieve.
Pre-Start
RDBMS and SQL
Business Outcome : Reports on Toy inventory and customer data
Learning Outcome 1 : Ability to write simple queries and sort the output

1. Display the toys which have a price more than $145 and the quantity is 5 Simple select with and Operator

Expected Output:

2. Display the customers in the ascending order (alphabetically by their name)


Expected output
Business Outcome : Reports on current inventory and RENTAL revenue from the Toys
Learning Outcome 2 : Ability to write queries based on a condition and sort the output
1. Display the Customer Count Based on the City Simple select with count

Expected output

2. Display the customer who has availed rental more than two toys currently Use inner join
Expected output

Business Outcome : Reports on rental details, most active/preferred customers, inactive customers,
customers who have defaulted payment/ return.
Learning Outcome 3 : Ability to write complex queries by fetching data from multiple tables.

1. Display the toys which was not at all rented out and display toy names in the ascending order of the
toy id.

Expected output

2. Display the toys which was rented out on 20/05/2020 Use inner join

Expected output
3. Display all the customers with the rental details even if they haven’t availed any toys for rental
Use joins and group by

Expected output

4.Fetch the toys which was on rent for maximum duration. . Use joins

Expected output

5.Display the Rental details of a customer “John” . Use Subquery

Expected output

6.Fetch the user information who have not returned the toys after the rental period
Expected output

7. Display all the rental details of a toy named PlayStix. Use Subquery

Expected output
8. Identify the customers who have opted for more than 1 toy for rental . Use joins
Expected output

Business Outcome : Reports to help maximize revenue (Best business months, most preferred toys,
most preferred customers)
Learning Outcome 4 : Ability to write queries using aggregate functions.
1. Display the customer details who has availed Electronic toys for rental.
Note: sort the output based on customer_id (Use Subquery)

Expected output

2. Display the ids of top 2 customers in descending order of total revenue generated for each
customer. Use group by/order by
Expected output

3. Identify top 3 customers customer_id and total_rentals based on the rentals in a descending order
Use Aggregate Functions

Expected output

Submission GuideLines
▪ Execute all the queries in your convenient database, and take the screenshot of the output.
▪ Filename: “Yourname SQL Assignment ”
▪ Upload on Lumen in the given placeholder

Happy SQL Coding!!

You might also like