ThinkSys interview question

Update sql command and joins