SQL Data Analysis Interview Question #28/100 | SQL Challenge | SQL Tutorials | Business analyst

preview_player
Показать описание
Welcome to Day 28 of my 100 Days Challenge!

Join me as I walk through each problem step-by-step, providing detailed explanations and practical tips. Don't forget to like, subscribe, and hit the bell icon to stay updated with daily challenges!

Links:
GitHub Repository - Get the question & datasets

Best Data Analytics Course:

My Other YouTube Videos -
SQL 30 Days Road Map - [Free Learning Resources]

#SQL #DataAnalysis #PortfolioProject #DataCleaning #BusinessAnalysis #DataAnalyst #SQLProject #EDA #SQLTutorial #GitHub #DataScience #CareerInData #LearnSQL #SQLforDataAnalyst #AspiringDataAnalyst #ResumeProject #EndToEndProject
Рекомендации по теме
Комментарии
Автор

One more solution


with cte as (SELECT *, date_format(sale_date, '%w') as days,
dayname(sale_date) as dayofnames, weekofyear(sale_date) as weeks FROM sales)

select weeks, sum(sale_amount) from cte
where dayofnames in ( 'Saturday', 'Sunday') and month(sale_date) = 7
group by 1

santhoshkumars
Автор

select
weekofyear(sale_date) as weekend, sum(sale_amount)
from
sales
where weekday(sale_date) in (5, 6)
and month(sale_date) =7
group by weekofyear(sale_date)
;
another solution

rishabhralli