4

I left a public copy of Stack Overflow 2017 survey dataset in BigQuery:

How can I find the top databases per country?

1 Answer 1

3

To find the top databases per country that people want to work on:

SELECT Country, c
  , ARRAY(
    SELECT AS STRUCT value, count, ROUND(100*count/SUM(count) OVER(PARTITION BY Country), 2) percent FROM UNNEST(v)
  ) v
FROM (
  SELECT Country, APPROX_TOP_COUNT(v, 10) v, COUNT(*) c
  FROM (
    SELECT Country, SPLIT(WantWorkDatabase, '; ') v
    FROM `fh-bigquery.stackoverflow.survey_results_public_2017`
  ), UNNEST(v) v
  WHERE v!='NA'
  GROUP BY 1
  HAVING c>10
  ORDER BY c DESC
)
ORDER BY c DESC

It's interesting to observe the variations between different countries.

The US top interests are PostgreSQL, SQL Server, and MongoDB:

enter image description here

While India is not very interested in PostgreSQL:

enter image description here

And the UK is very interested in SQL Server:

enter image description here

And Germany has both MySQL and PostgreSQL on top:

enter image description here

Most countries are not very interested in Cassandra or Oracle, but Israel shows a surprising interest for Cassandra:

enter image description here

While Pakistan shows above average interest for Oracle:

enter image description here

Charting the interest for MySQL, MongoDB and PostgreSQL:

enter image description here


enter image description here


enter image description here

And the rest, on an interactive Data Studio dashboard.

(feel free to tag me on https://twitter.com/felipehoffa)

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.