I rarely had the chance to write RAW SQL query, I wrote this query but feel like something is not right about it. I wonder if there is a better way to write it. Maybe I will