Skip to content

Instantly share code, notes, and snippets.

@jpustula
Last active December 14, 2015 19:09
Show Gist options
  • Save jpustula/5134978 to your computer and use it in GitHub Desktop.
Save jpustula/5134978 to your computer and use it in GitHub Desktop.
[Część 1]
2. True
4.
DESCRIBE hr.departments;
SELECT * FROM hr.departments;
5.
DESCRIBE hr.EMPLOYEES;
SELECT EMPLOYEE_ID, last_name, job_id, hire_date
FROM hr.EMPLOYEES;
6. success
8.
SELECT EMPLOYEE_ID "Emp #", last_name "Employee", job_id "Job", hire_date "Hire Date"
FROM hr.EMPLOYEES;
10.
SELECT last_name || ': 1 Month salary = ' || salary
FROM hr.EMPLOYEES;
12.
SELECT last_name, department_id
FROM hr.EMPLOYEES
WHERE employee_id = 176;
14.
SELECT last_name, job_id, hire_date
FROM hr.EMPLOYEES
WHERE hire_date BETWEEN to_date('20-02-1998', 'DD-MM-YYYY') AND to_date('01-05-1998', 'DD-MM-YYYY')
ORDER BY hire_date ASC;
16.
SELECT last_name "Employee", salary "Monthly Salary"
FROM hr.EMPLOYEES
WHERE salary BETWEEN 5000 AND 12000
AND department_id IN(20, 50);
18.
SELECT last_name, job_id
FROM hr.EMPLOYEES
WHERE manager_id IS NULL;
20.
SELECT last_name
FROM hr.EMPLOYEES
WHERE last_name LIKE '__a%';
22.
SELECT last_name, job_id, salary
FROM hr.EMPLOYEES
WHERE job_id IN('SA_REP', 'ST_CLERK')
AND salary NOT IN(2500, 3500, 7000);
[Część 2]
2.
SELECT employee_id, last_name, job_id, salary, ROUND(salary * 1.15) "New Salary"
FROM hr.EMPLOYEES;
4.
SELECT initcap(last_name), LENGTH(last_name)
FROM hr.EMPLOYEES
WHERE last_name LIKE 'J%'
OR last_name LIKE 'A%'
OR last_name LIKE 'M%';
6.
SELECT last_name, hire_date, to_char(hire_date, 'DAY') "DAY"
FROM hr.EMPLOYEES
ORDER BY to_char(hire_date, 'D') ASC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment