ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 26 May 2017 My Price 8.00

Create a trigger calledjob_min_sal_trgon

Here's another question that I hope you can assist me with?

 

Create a trigger calledjob_min_sal_trgon theemployeetable. When anINSERTorUPDATEstatement is issued against theemployeetable, the trigger is fired to ensure that the value of theSALARYcolumn meetsthe criteria in thejob_minimum_salarytable.(For example, you can findthat the minimum salary for a programmer is 800 from thejob_minimum_salarytable. Your triggerensures that the salary for a programmer in theemployeetable is greater than or equal to 800.)Step 1) (0 point) Create a tablejob_minimum_salaryas follows.CREATE TABLE job_minimum_salary(JOBVARCHAR2(50) PRIMARY KEY,SALARYNUMBER(7, 2) NOT NULL);Step 2) (0 point) Populate thejob_minimum_salarytable as follows.INSERT INTO job_minimum_salary VALUES ('ANALYST', 2000);INSERT INTO job_minimum_salary VALUES ('DATABASE ADMINISTRATOR', 2500);INSERT INTO job_minimum_salary VALUES ('PRESIDENT', 4800);INSERT INTO job_minimum_salary VALUES ('PROGRAMMER', 800);INSERT INTO job_minimum_salary VALUES ('PUBLIC ACCOUNTANT', 2400);INSERT INTO job_minimum_salary VALUES ('SALESMAN', 1800);INSERT INTO job_minimum_salary VALUES ('VICE PRESIDENT', 3800);INSERT INTO job_minimum_salary VALUES ('TBA', 1800);COMMIT;Step 3) Create the triggerjob_min_sal_trg.Thejob_minimum_salarytable is read-only. Your triggercannotmodify any rows in thejob_minimum_salarytable.You must get the minimum salaries from thejob_minimum_salarytable in your program.Hard coding, except the string'TBA', is not allowed in your program (e.g.,IF job ='SALESMAN' THEN v_min_sal = 1800 …).If the job cannot be found from thejob_minimum_salarytable (e.g., Program Facilitator),the job is considered as “TBA”. (You need to check whether the salary is equal to or greater thanthe minimum salary forjob='TBA'.)If the salary is equal to or greater than the minimum salary of the corresponding job, the triggerdoes not change anything.If the salary is less than the minimum salary of the corresponding job, the trigger increases thesalary to the minimum salary of the corresponding job.No temporary table/view/procedure/function is allowed in your program.To avoid amutating table error, please take a look examples on page 6, class handout 8.(Hint:you cannot use someINSERT/UPDATEstatements to modify theemployeetable in yourtrigger.)You will get a zero point if you use a different trigger name.If you modified theemployeetable created in Assignment #1, please delete and re-populate it.Step 4) Test your trigger.

Attachments:

Answers

(11)
Status NEW Posted 26 May 2017 08:05 AM My Price 8.00

-----------

Not Rated(0)