SQL contains solved problem from SQL-ex.ru site.