Skip to content

Latest commit

 

History

History
15 lines (15 loc) · 723 Bytes

601. Human Traffic of Stadium.md

File metadata and controls

15 lines (15 loc) · 723 Bytes

601. Human Traffic of Stadium

Question Link

Solution

# Write your MySQL query statement below
select s1.id, s1.visit_date, s1.people from Stadium s1, Stadium s2, Stadium s3
where s1.id=s2.id-1 and s2.id=s3.id-1 and s1.people>=100 and s2.people>=100 and s3.people>=100
union
select s2.id, s2.visit_date, s2.people from Stadium s1, Stadium s2, Stadium s3
where s1.id=s2.id-1 and s2.id=s3.id-1 and s1.people>=100 and s2.people>=100 and s3.people>=100
union
select s3.id, s3.visit_date, s3.people from Stadium s1, Stadium s2, Stadium s3
where s1.id=s2.id-1 and s2.id=s3.id-1 and s1.people>=100 and s2.people>=100 and s3.people>=100
order by visit_date