Explore Shark Tank investments with SQL. Uncover insights, success rates, and industry preferences. Based on the SQL script provided, here are the problem statements and their corresponding solutions:
Determine the total number of episodes in Season 1.
Use the MAX
function to find the highest episode number and the COUNT DISTINCT
function to count unique episodes.
-- Total number of episodes
SELECT MAX(ep_no) FROM shark_data;
SELECT COUNT(DISTINCT ep_no) FROM shark_data;
Calculate the conversion rate of pitches to deals in Season 1.
Count the number of pitches that resulted in an investment and divide by the total number of pitches.
-- Conversion rate of pitches to deals
SELECT CAST(SUM(a.converted_not_converted) AS FLOAT) / CAST(COUNT(*) AS FLOAT) FROM (
SELECT amount_invested_lakhs, CASE WHEN amount_invested_lakhs > 0 THEN 1 ELSE 0 END AS converted_not_converted FROM shark_data
) a;
Analyze the gender distribution of entrepreneurs in Season 1.
Sum the total number of male and female participants and calculate the gender ratio.
-- Gender distribution analysis
SELECT SUM(male) FROM shark_data;
SELECT SUM(female) FROM shark_data;
SELECT SUM(female) / SUM(male) FROM shark_data;
Identify the startup with the highest investment in each sector for Season 1.
Rank startups within each sector by the amount invested and select the top-ranked startup per sector.
-- Startup with the highest investment per sector
SELECT c.* FROM (
SELECT brand, sector, amount_invested_lakhs, RANK() OVER (PARTITION BY sector ORDER BY amount_invested_lakhs DESC) rnk
FROM shark_data
) c
WHERE c.rnk = 1;