The query() function
The query() method of the Sql.sql object is the "simple" query interface. It is meant to be used for those queries that return little or no data.
It's signature could look frightening:
array(mapping(string:string|float|int)) query (string sql)
but it isn't that bad, really.
The returned value is an array, one element for every row, of mappings whose indices are the column names, and values the column contents.
So in order to access the "foo" column in the fourth returned row, you'll use
mixed datum = db->foo;
If there are no results, the method will return an empty array.
Find out the country code for Italy
The reason why this interface is only suited for simple queries is that it will fetch the whole results set and store it locally. It's not that big a deal for small databases, but make a small mistake in specifying the query on an HUGE database, and it will be tens or hundreds of megabytes to fetch. Talk about bloat... If you're going to retrieve potentially huge data-sets, you'll need the big_query interface instead. It's a bit more complex to use, but it will allow you fetch results on demand.