added new SQL logic script