Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Toate functiile SQL- tema suplimentara lab3

Select 5*2+3 from dual;

select last_name || first_name as "Nume" from employees where lower(last_name) = 'king';

select last_name || first_name as "Nume" from employees where upper(last_name) = 'KING';

select last_name || first_name as "Nume" from employees where initcap(last_name) = 'King';

select concat ('Tema', 'Baze') from dual;

select concat(first_name, salary) from employees;

select substr('Bunaziua',1,5) from dual;

select substr('Bunaziua',5) from dual;

select length ('aloalo') from dual;

select instr('ana are mere', 'r') from dual;

select LPAD(last_name, 10, '+') from employees;pune la stanga +

select RPAD(last_name, 10, '+') from employees;pune la dreapta +

select trim(leading 'a' from 'abadca') from dual;

select trim(trailing 'a' from 'abadca') from dual;

select trim(both 'a' from 'abadca') from dual;

select replace('nurse','n','b') from dual;

select replace('nurse','n') from dual;

select first_name, last_name from employees where department_id=:enter_dept_id;

select * from employees where last_name =:l_name;

select round(41.531,-1) from dual;

select trunc(41.531,2) from dual;

select mod(23,2) from dual;

select sysdate from dual;

select add_months(sysdate,12) from dual;

select next_day(sysdate,'Sunday') from dual;

select last_day(sysdate-16) from dual;

select round(sysdate,'month') from dual;

select trunc(sysdate,'day') from dual;


select to_char(hire_date, 'fmMonth ddth, YYYY') from employees;

select to_char(hire_date, 'fmDay ddthsp Month, YYYY') as "Data" from employees

select to_char(sysdate, 'hh:mm:ss') from dual

select to_char(51432, '$99,999') from dual

select to_number('51,432', '99,999') from dual

select to_date('13 September 1999', 'DD Mon YY') from dual;

select to_date('1999Sep13', 'fxYYYYMonDD') from dual;

select last_name, NVL(commission_pct, 0) from employees order by commission_pct;

select last_name,coalesce(commission_pct, salary,100) from employees order by commission_pct desc;

select country_name,
case region_id
when 1 then 'first'
when 2 then 'second'
else 'zeroo'
end as "Sector"
from countries;

You might also like