I started using Oracle PL / SQL, and I downloaded Oracle Database 10g Express with the same examples and questions.
There is a question that I could not solve.
Question:
Write an SQL query to retrieve the name, surname and code of each employee where the employee code is found: First, delete all occurrences of the characters "i" and "l", then combine the first six letters of the name, the "-" sign, and the last six characters of the surname , where only the first and last Character of the code should be uppercase. If the name does not contain six letters, put underscores (") at the end of the fragment; if the last name does not contain six letters, put underscores (" ") at the beginning of the work. Order the list according to the last name and then according to the name.
EXIT SHOULD BE SO THAT

I wrote something, but it’s not so clear. What parts should I fix?
SELECT employees.first_name, employees.last_name,
replace(replace(first_name,'l',''),'i'),
initcap(substr(rpad(employees.first_name,6,'_'),1,6)) || '-' ||
case when length(employees.last_name)>4
then lower(substr(employees.last_name,-5,4))
else lower(substr(lpad(employees.last_name,5,'_'),-5,4)) end ||
upper(substr(employees.last_name,-1,1)) code
FROM employees
ORDER BY last_name, first_name;
This is my conclusion (WRONG)
