Interesting way how to alter data in one table based on a query from another table.
UPDATE member SET status='excellent' FROM job WHERE job.salary > 5000 AND member.job_id = job.job_id;
This query will set member.status to be 'excellent' where ever a member.job_id refers to a job with salary greater than 5000.
For reference:
Table member columns are status and job_id, among others, where job_is is a foreign key to table job.
Table job columns are job_id as primary key and salary as a number.
UPDATE member SET status='excellent' FROM job WHERE job.salary > 5000 AND member.job_id = job.job_id;
This query will set member.status to be 'excellent' where ever a member.job_id refers to a job with salary greater than 5000.
For reference:
Table member columns are status and job_id, among others, where job_is is a foreign key to table job.
Table job columns are job_id as primary key and salary as a number.