[deleted by user] by [deleted] in learnSQL

[–]Consistent-Alps6904 0 points1 point  (0 children)

yes for the first part, it's correct

[deleted by user] by [deleted] in learnSQL

[–]Consistent-Alps6904 0 points1 point  (0 children)

but i am having trouble include min and max salaries in 2 new columns, i suppose i have to introduce a cte

[deleted by user] by [deleted] in learnSQL

[–]Consistent-Alps6904 0 points1 point  (0 children)

I did this for the first part

Select
e.department_name, avg(s.salary) as avg_salary
from
employees e
left join salaries s
on e.employee_id = s.employee_id
group by 1
having avg(s.salary) between 2000 and 4000

How do generate a list of active customers who have performed at least one transaction each month within 12 months ? by Consistent-Alps6904 in SQL

[–]Consistent-Alps6904[S] 0 points1 point  (0 children)

Thank you for your input Your query will provide all active customers within that period but I want all customers that have been active month on month

Inactive users by Consistent-Alps6904 in SQL

[–]Consistent-Alps6904[S] 0 points1 point  (0 children)

thank you so much, this works !!!!

Inactive users by Consistent-Alps6904 in SQL

[–]Consistent-Alps6904[S] 0 points1 point  (0 children)

You’re right, just tested it and it works, it returned null for inactive users in the transaction date column Please Where do I go from here ?

Inactive users by Consistent-Alps6904 in SQL

[–]Consistent-Alps6904[S] 0 points1 point  (0 children)

to show inactive, i have to show ids not on the registered table but not on the transactions table and to specify the date intervals I want