SQL details - improvements

Change-Id: I7b30690bea587179169f70a63caad607e9b62510