in reply to Composing a SQL statement

Just change the " %s LIKE %s" to " %s LIKE %s AND ", this will insert the missing 'AND'.
You have to remove the trailing 'AND' though, just like this (before you append the ')'):
$sql =~ s/AND$//;