SQL can be very simple

Let’s add on to the SQL query:

SELECT *

FROM database_table

WHERE Total Speakers > 200,000,000

AND Family = ‘Indo-European‘

ORDER BY First-language DESC

  • AND — In a WHERE clause, you can have multiple filters. Above, it’s filtering for Total Speakers above 200,000,000 AND where the Branch is ‘Indo-European’ so it will exclude the row with Mandarin Chinese and Modern Standard Arabic since their Family type is not Indo-European.

  • ORDER BY — This specifies the ordering for the returned rows. We’re going to sort by First-language, so Mandarin Chinese would show up first since its First-Language is 939 mn, followed by Spanish (485 mn) and English (380 mn) and so on. If we did not have this like in the previous page, it would by default sort by Total Speakers, the last column.