You are on page 1of 5

Forum Basis Data Kelas E & F

1. The HR department needs to find high-salary and low-salary employees. Display the last name and salary for any employee whose salary is not in the range of $5,000 to $12,000. Give both the script & screenshot!

Terjemahan Departemen HR perlu mencari gaji karyawan tinggi dan gaji rendah. Tampilkan nama belakang dan gaji untuk setiap karyawan yang gajinya tidak dalam kisaran $ 5,000 sampai $ 12,000. Berikan script & screenshot

Script
select last_name, salary from employees where salary not between 5000 and 12000;

2. The HR department needs a report that displays the last name and hire date for all employees who were hired in 1994. Give both the script & screenshot!

terjemahannya: Departemen HR perlu laporan yang menampilkan nama terakhir dan tanggal masuk untuk semua karyawan yang dipekerjakan pada tahun 1994. Berikan script & screenshot!
select last_name, hire_date from employees where hire_date like '%94'

3. Display the last names of all employees who have both an "a" and an "e" in their last name. Give both the script & screenshot!

terjemahan: Tampilan nama terakhir dari semua karyawan yang memiliki dua huruf "a" dan "e" dalam nama terakhir mereka. Berikan kedua script & screenshot!
select last_name from employees where last_name like '%a' or last_name like '%e';

4. Display the last name, job, and salary for all employees whose jobs are either sales representative or stock clerk and whose salaries are not equal to $2,500, $3,500, or $7,000. Give both the script & screenshot!

Tampilkan nama belakang, pekerjaan, dan gaji untuk semua karyawan yang pekerjaannya baik pegawai perwakilan atau penjualan saham dan gaji yang tidak sama dengan $ 2.500, $ 3.500, atau $ 7.000. Berikan kedua script & screenshot!
select last_name, job_id, salary from employees where job_id in ('ST_CLERK','SA_REP') and salary not in (2500 ,3500, 7000)

5. Find the difference between the highest and lowest salaries. Label the column DIFFERENCE. Give both the script & screenshot!

Temukan perbedaan antara gaji tertinggi dan terendah. Label kolom DIFFERENCE. Berikan keduanya script & screenshot!
select max (salary), min (salary),max (salary) - min (salary) DIFFERENCES from employees;

6. The HR department needs to find the names and hire dates for all employees who were hired before their managers, along with their managers' names and hire dates (total: 4 columns). Give both the script & screenshot! Departemen HR perlu mencari nama dan tanggal masuk kerja untuk semua karyawan yang dipekerjakan sebelum manajer mereka, bersama dengan nama manajer mereka dan tanggal masuk kerja (total: 4 kolom). Berikan kedua script & screenshot!
select emp.first_name, emp.hire_date, mng.first_name, mng.hire_date from employees emp JOIN employees mng ON (emp.manager_id = mng.employee_id) where emp.hire_date < mng.hire_date

7. Display all employee last names in which the third letter of the name is "a". Give both the script & screenshot! tampilkan last names yang berada pada tabel employees dimana huruf ketiga dari nama tersebut adalah "a". berikan scriptnya dan screenshotnya
select last_name from employees where last_name like '__a%'

8. Create a report to display the last name, salary, and commission of all employees who earn commissions. Sort data in descending order of salary and commissions! Give both the script & screenshot!

Membuat laporan untuk menampilkan nama belakang, gaji, dan komisi dari semua karyawan yang mendapatkan komisi. Urutkan data dalam urutan gaji dan komisi! Berikan kedua script & screenshot.
select last_name, salary, commission_pct from employees where commission_pct is not null order by salary desc,commission_pct desc

You might also like