Users age distribution, average users distribution in different years [AskDifferent]

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

select Age, count(*) as NumberOfUsers
    from Users
    where not(Age is null)
    group by Age
    order by Age;
    
select * from
    (select min(Age) as UsersMinimumAge, max(Age) as UsersMaximumAge, 
            round(avg(cast(Reputation as float)),2) as AllUsersAverageReputation
            from Users) as a,
    (select count(*) as Number_of_Users_without_filled_Age from Users 
        where Age is null) as d, 
    (select count(*) as Number_of_Users_with_filled_Age from Users 
        where not(Age is null)) as e,          
    (select round(avg(cast(Reputation as float)),2) as UsersWithAgeAverageReputation 
      from Users where not(Age is null)) as b,
    (select round(avg(cast(Reputation as float)),2) as UsersWithoutAgeAverageReputation 
      from Users where Age is null) as c ;

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results