Added SQL query

SQL query added and functioning