0% found this document useful (0 votes)
5 views2 pages

Bazy 1 ĆW

The document contains a series of SQL queries for retrieving and manipulating employee and department data from a database. It includes selections of various fields, calculations of salaries, and formatting of names, as well as ordering and filtering results based on specific criteria. The queries demonstrate operations such as aggregation, renaming columns, and handling null values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Bazy 1 ĆW

The document contains a series of SQL queries for retrieving and manipulating employee and department data from a database. It includes selections of various fields, calculations of salaries, and formatting of names, as well as ordering and filtering results based on specific criteria. The queries demonstrate operations such as aggregation, renaming columns, and handling null values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

1)

SELECT
*
FROM
dept;
2)
SELECT
DEPT_ID,
LAST_NAME,
MANAGER_ID
FROM
emp;
3)
SELECT
salary*12,
last_name
FROM
emp;
4)
SELECT
first_name AS "Imię",
last_name AS "Nazwisko",
salary AS "Zarobki miesięczne",
salary * 12 + 1000 AS "Roczne z premią"
FROM
emp;
5)
SELECT
first_name AS "Imię",
last_name AS "Nazwisko",
salary * 1.08 AS "Zarobki mieści się",
salary * 1.08 * 12 AS "Zarobki roczne"
FROM
emp;
6)
SELECT
last_name,
salary * 11 + salary * 1.05 AS "ROCZNY DOCHÓD"
FROM
emp;
7)
SELECT
first_name || ' ' || last_name AS "Imię i nazwisko"
FROM
emp;
8)
SELECT
first_name || ' ' || last_name || ' - ' || title AS "Super Pracownicy"
FROM
emp;
9)
SELECT
last_name,
salary,
title,
commission_pct * salary / 100 AS prowizja
FROM
emp;
10)
SELECT
last_name,
salary,
title,
NVL(commission_pct * salary / 100, 0) AS prowizja
FROM
emp;
11)
SELECT
DISTINCT name
FROM
dept;
12)
SELECT
last_name,
dept_id,
salary,
start_date
FROM
emp
ORDER BY
dept_id ASC,
salary DESC;
13)
SELECT
last_name,
dept_id,
start_date
FROM
emp
ORDER BY
start_date ASC;
14)
SELECT
first_name,
last_name,
title
FROM
emp
WHERE
last_name = 'Patel';
15)
SELECT id, name, region_id FROM dept WHERE region_id = 1 AND region_id = 3;

You might also like