You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Soru 2) 1980’den itibaren herhangi bir spor grubunda üst üste 3 veya daha fazla madalya almış atletleri bulalım.
create or replacetabledsmbootcamp.veysel_sekendiz.second_answeras
with all_athlete as
(
select athlete,
lag(year,1) over (partition by athlete order by year) as prev,
year,
lead(year,1) over(partition by athlete order by year) as forw
from`dsmbootcamp.veysel_sekendiz.summer_medals`where year >=1980group by athlete, year
order by athlete
)
select distinct athlete
from all_athlete
where prev is not nulland forw is not nullorder by athlete
Düzeltme
create or replace table `dsmbootcamp.veysel_sekendiz.second_answer`as
with all_athlete as
(
select athlete,
lag(year,1) over (partition by athlete order by year) as prev,
year,
lead(year,1) over(partition by athlete order by year) as forw
from`dsmbootcamp.veysel_sekendiz.summer_medals`where year >=1980group by athlete, year
order by athlete
)
select distinct athlete
from all_athlete
where year-prev=4and forw-year=4//4 yıl öncesi ve 4 yıl sonrasını belirttik
order by athlete