Skip to content

Tag: percentage

SQL relative percentage for each country

I have a table: maps_query like below: The question is to output the relative percentage of queries for maps_query for each country. Desired output is like below: I don’t quite understand what relative percentage is here but I assumed it’s asking to output (a country’s search_query counts/ a…

MYSQL Query calculate percentage of emails not null

I have these two queries. Caluculates count of emails that are null SELECT COUNT(*) as invalid_email FROM distinct_customers WHERE c_email IS NULL; Calculates count of every email SELECT COUNT(distinct c_number) as total FROM distinct_customers; I am trying to combine those to queries so that it gives me a pe…