HANA-compatible version of Mohammad's queries

These are Four HANA-compatible scripts that are translated from the
queries that Mohammad sent.