Query provides a set of methods to facilitate the specification of different clauses
in a SELECT statement. These methods can be chained together.
By calling Query::createCommand, we can get a Command instance which can be further
used to perform/execute the DB query against a database.
For example,
~~~
$query = new Query;
compose the query
$query->select('id, name')
->from('tbl_user')
->limit(10);
build and execute the query
$rows = $query->all();
alternatively, you can create DB command and execute it
$command = $query->createCommand();
$command->sql returns the actual SQL
$rows = $command->queryAll();
~~~