0% found this document useful (0 votes)
3 views6 pages

Taller 4

The document outlines several SQL queries related to employee data, including salary calculations, hire dates, and commission statuses. Each query is followed by a placeholder for results, indicating the intended output format. The queries utilize various SQL functions such as CONCAT, TO_CHAR, and CASE for data manipulation and presentation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views6 pages

Taller 4

The document outlines several SQL queries related to employee data, including salary calculations, hire dates, and commission statuses. Each query is followed by a placeholder for results, indicating the intended output format. The queries utilize various SQL functions such as CONCAT, TO_CHAR, and CASE for data manipulation and presentation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 6

TALLER 4

PUNTO 1:

CONSULTA: SELECT last_name || ' ' || 'earns salary' || ' ' ||


concat('$',TO_CHAR(salary,'99,999.00')) || ' ' || 'monthly but wants' || ' ' ||
TO_CHAR((salary*3),'99,999.00') AS "Dream Salaries" from employees;

RESULTADO:

PUNTO 2:

CONSULTA: select last_name,TO_CHAR(hire_date,'DD-MON-YY'), 'Monday' || ',' || 'The'|| ' ' ||


TO_CHAR(NEXT_DAY(ADD_MONTHS(hire_date,6),'Lunes'),'DD "of" month,YYYY') AS review from
employees;

RESULTADO:
PUNTO 3:

CONSULTA: SELECT last_name,hire_date, UPPER(TO_CHAR(hire_date,'day')) AS day from


employees;

RESULTADO:
PUNTO 4:

CONSULTA: SELECT last_name, CASE WHEN TO_CHAR(COMMISSION_PCT, '.00') IS NULL THEN 'No
Commission' ELSE (TO_CHAR(COMMISSION_PCT, '.00')) END AS COMM FROM employees;

RESULTADO:
PUNTO 5:

CONSULTA: SELECT JOB_ID, DECODE(JOB_ID,'AD_PRES','A',

'ST_MAN','B',

'IT_PROG','C',

'SA_REP','D',

'ST_CLERK','E',

'0') AS grade FROM EMPLOYEES;

RESULTADO:
PUNTO 6:

CONSULTA: SELECT JOB_ID, CASE WHEN JOB_ID = 'AD_PRES' THEN 'A'

WHEN JOB_ID = 'ST_MAN' THEN 'B'

WHEN JOB_ID = 'IT_PROG' THEN 'C'

WHEN JOB_ID = 'SA_REP' THEN 'D'

WHEN JOB_ID = 'ST_CLERK' THEN 'E'

ELSE '0' END AS grade FROM EMPLOYEES;

RESULTADO:

You might also like