coding conventions (sql queries)

Change-Id: Iaf1fd195267c819b5a23f152f96e48f6c951f548