4. How to write a simple SQL Query in Big Query

#SQL #queries #BigQuery

Starting from the custom table I created here, click on Query:

Start writing your query from this pane

Question: Which are the Top 5 Most Common male Birth Names in Italy in 1999?

In SQL pane write:

SELECT

  nome,

  nati

FROM `nasciteitalia.datinasciteItalia.diffusionenomi`

WHERE

  anno=1999

ORDER BY

  nati DESC

LIMIT

  5

This query selects from the data table ‘diffusionenomi’ in database ‘datinasciteItalia’ in project ‘nasciteitalia’ the  two columns (‘nome’ and ‘nati’) for the year ‘1999’ and sorts these two columns in descending order limiting the results to 5 items.

Click RUN to see the results:

Check with the reference table from Istat:

Comments

Leave a Reply