You are on page 1of 2

1

-- Listar nome e sobrenome ordenado por sobrenome

SELECT first_name, last_name FROM employees ORDER BY last_name;

--Liste os funcionários que têm salário superior a R$ 1.000,00 ordenados pelo nome completo

SELECT * FROM employees WHERE salary > 1000 ORDER BY first_name, last_name;

--Liste os funcionários como uma listagem telefônica, ordenar por telefone

SELECT first_name, last_name, phone_number FROM employees WHERE phone_number


BETWEEN '1' AND '99999999999999' ORDER BY phone_number;

Operador Like

SELECT first_name FROM employees WHERE first_name LIKE '%d'

-- Selecione os nomes dos funcionários que foram contratados entre 11/05/2004 e 21/04/2018

SELECT FIRST_NAME AS NOME,

HIRE_DATE AS DT_CONTRATACAO

FROM employees WHERE

HIRE_DATE BETWEEN '11/05/2004' AND '21/04/2018';


6

-- Selecione

SELECT FIRST_NAME AS NOME,

LAST_NAME AS SOBRENOME,

HIRE_DATE AS DT_CONTRATACAO,

d.DEPARTMENT_NAME

FROM employees e JOIN departments d

ON e.DEPARTMENT_ID = d.DEPARTMENT_ID

WHERE HIRE_DATE BETWEEN '11/05/2004' AND '21/04/2018';

You might also like