JewelHyukie

Just another WordPress.com site

Tugas 5 (Praktek)

on December 19, 2012

1. menampilkan tabel employees / karyawan:

SELECT * FROM employees;

 

2. menampilkan first_name, last_name, salary, department_id, dan department_name dari tabel employees dan departments:

select first_name,last_name,salary,departments.department_id,department_name
from employees,departments;

 

3. menampilkan fisrt_name, last_name, salary, department_id, dan department_name dari tabel employees dan departments dimana kunci relasi antara tabel employees dan departments adalah department_id:

select first_name,last_name,salary,departments.department_id,department_name
from employees,departments
where employees.department_id = departments.department_id;

 

4. menampilkan first_name,last_name,salary,department_name,job_title dari tabel employees, departments, dan jobs dimana kunci relasi antara tabel employees dan departments adalah department_id dan antara employees dan jobs adalah job_id

select first_name,last_name,salary,department_name,job_title
from employees,departments,jobs
where employees.department_id = departments.department_id and employees.job_id = jobs.job_id;

 

5. menampilkan first_name,salary,job_title,min_salary,max_salary dari tabel employees dan jobs dimana gaji karyawan berada diantara min_salary dan max_salary berdasarkan first_name:

select first_name,salary,job_title,min_salary,max_salary
from employees,jobs
where employees.salary between jobs.min_salary and jobs.max_salary
order by first_name;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: