SlideShare a Scribd company logo
1 of 2
1. Create and invoke the ADD_JOB procedure and consider the results.
a. Create a procedure called ADD_JOB to insert a new job into the JOBS table.
Provide the ID and title of the job, using two parameters.
b. Compile the code, and invoke the procedure with IT_DBA as job ID and
Database Administrator as job title. Query the JOBS table to view the results.
c. Invoke your procedure again, passing a job ID of ST_MAN and a job title of
Stock Manager. What happens and why?


2. Create a procedure called UPD_JOB to modify a job in the JOBS table.
a. Create a procedure called UPD_JOB to update the job title. Provide the job
ID and a new title, using two parameters. Include the necessary exception
handling if no update occurs.
b. Compile the code; invoke the procedure to change the job title of the job ID
IT_DBA to Data Administrator. Query the JOBS table to view the results.
Also check the exception handling by trying to update a job that does not exist
(you can use job ID IT_WEB and job title Web Master).
3. Create a procedure called DEL_JOB to delete a job from the JOBS table.
a. Create a procedure called DEL_JOB to delete a job. Include the necessary
exception handling if no job is deleted.
b. Compile the code; invoke the procedure using job ID IT_DBA. Query the
JOBS table to view the results.
Also, check the exception handling by trying to delete a job that does not exist
(use job ID IT_WEB). You should get the message you used in the exception-
handling section of the procedure as output.


4. Create a procedure called QUERY_EMP to query the EMPLOYEES table,
retrieving the salary and job ID for an employee when provided with the
employee ID.
a. Create a procedure that returns a value from the SALARY and JOB_ID
columns for a specified employee ID. Use host variables for the two OUT
parameters salary and job ID.
b. Compile the code, invoke the procedure to display the salary and job ID for
employee ID 120.
c. Invoke the procedure again, passing an EMPLOYEE_ID of 300. What
happens and why?

More Related Content

What's hot

Oracle OCP 1Z0-007题库
Oracle OCP 1Z0-007题库Oracle OCP 1Z0-007题库
Oracle OCP 1Z0-007题库renguzi
 
Sql Commands
Sql CommandsSql Commands
Sql CommandsSachin MK
 
Aggregate functions
Aggregate functionsAggregate functions
Aggregate functionssinhacp
 
PHP mysql Aggregate functions
PHP mysql Aggregate functionsPHP mysql Aggregate functions
PHP mysql Aggregate functionsMudasir Syed
 
MYSQL Aggregate Functions
MYSQL Aggregate FunctionsMYSQL Aggregate Functions
MYSQL Aggregate FunctionsLeroy Blair
 
Database object, sub query, Join Commands & Lab Assignment
Database object, sub query, Join Commands & Lab AssignmentDatabase object, sub query, Join Commands & Lab Assignment
Database object, sub query, Join Commands & Lab AssignmentArun Sial
 
Aggregate Functions,Final
Aggregate Functions,FinalAggregate Functions,Final
Aggregate Functions,Finalmukesh24pandey
 
Aggregate Function - Database
Aggregate Function - DatabaseAggregate Function - Database
Aggregate Function - DatabaseShahadat153031
 
Les06 (using subqueries to solve queries)
Les06 (using subqueries to solve queries)Les06 (using subqueries to solve queries)
Les06 (using subqueries to solve queries)Achmad Solichin
 
e computer notes - Using set operator
e computer notes - Using set operatore computer notes - Using set operator
e computer notes - Using set operatorecomputernotes
 
Using subqueries to solve queries
Using subqueries to solve queriesUsing subqueries to solve queries
Using subqueries to solve queriesSyed Zaid Irshad
 

What's hot (20)

1 z0 047
1 z0 0471 z0 047
1 z0 047
 
Oracle OCP 1Z0-007题库
Oracle OCP 1Z0-007题库Oracle OCP 1Z0-007题库
Oracle OCP 1Z0-007题库
 
1 z0 001
1 z0 0011 z0 001
1 z0 001
 
Sql queires
Sql queiresSql queires
Sql queires
 
My Sql
My Sql My Sql
My Sql
 
Sql Commands
Sql CommandsSql Commands
Sql Commands
 
Aggregate functions
Aggregate functionsAggregate functions
Aggregate functions
 
PHP mysql Aggregate functions
PHP mysql Aggregate functionsPHP mysql Aggregate functions
PHP mysql Aggregate functions
 
MYSQL Aggregate Functions
MYSQL Aggregate FunctionsMYSQL Aggregate Functions
MYSQL Aggregate Functions
 
Database object, sub query, Join Commands & Lab Assignment
Database object, sub query, Join Commands & Lab AssignmentDatabase object, sub query, Join Commands & Lab Assignment
Database object, sub query, Join Commands & Lab Assignment
 
Aggregate Functions,Final
Aggregate Functions,FinalAggregate Functions,Final
Aggregate Functions,Final
 
Aggregate Function - Database
Aggregate Function - DatabaseAggregate Function - Database
Aggregate Function - Database
 
Les15
Les15Les15
Les15
 
Les06 (using subqueries to solve queries)
Les06 (using subqueries to solve queries)Les06 (using subqueries to solve queries)
Les06 (using subqueries to solve queries)
 
Aggregate function
Aggregate functionAggregate function
Aggregate function
 
e computer notes - Using set operator
e computer notes - Using set operatore computer notes - Using set operator
e computer notes - Using set operator
 
Les04
Les04Les04
Les04
 
Les06
Les06Les06
Les06
 
Using subqueries to solve queries
Using subqueries to solve queriesUsing subqueries to solve queries
Using subqueries to solve queries
 
Oracle: Functions
Oracle: FunctionsOracle: Functions
Oracle: Functions
 

Similar to Practice create procedure

keep it simple pls Create a project named labExamCCCS221 containing fo.docx
keep it simple pls Create a project named labExamCCCS221 containing fo.docxkeep it simple pls Create a project named labExamCCCS221 containing fo.docx
keep it simple pls Create a project named labExamCCCS221 containing fo.docxrennaknapp
 
33.docxSTEP 1 Understand the UML Diagram Analyze and under.docx
33.docxSTEP 1 Understand the UML Diagram Analyze and under.docx33.docxSTEP 1 Understand the UML Diagram Analyze and under.docx
33.docxSTEP 1 Understand the UML Diagram Analyze and under.docxgilbertkpeters11344
 
Oracle - Program with PL/SQL - Lession 09
Oracle - Program with PL/SQL - Lession 09Oracle - Program with PL/SQL - Lession 09
Oracle - Program with PL/SQL - Lession 09Thuan Nguyen
 
Cis 407 i lab 5 of 7
Cis 407 i lab 5 of 7Cis 407 i lab 5 of 7
Cis 407 i lab 5 of 7helpido9
 
MIS 562 help Successful Learning/Snaptutorial
MIS 562 help Successful Learning/SnaptutorialMIS 562 help Successful Learning/Snaptutorial
MIS 562 help Successful Learning/Snaptutorialwilliamtrumpz3h
 
MIS 562 help A Guide to career/Snaptutorial
MIS 562 help A Guide to career/SnaptutorialMIS 562 help A Guide to career/Snaptutorial
MIS 562 help A Guide to career/Snaptutorialwilliamtrumpz2K
 
Mis 562 Massive Success - snaptutorial.com
Mis 562 Massive Success - snaptutorial.comMis 562 Massive Success - snaptutorial.com
Mis 562 Massive Success - snaptutorial.comStephenson183
 
Mis 562 Success Begins / snaptutorial.com
Mis 562  Success Begins / snaptutorial.comMis 562  Success Begins / snaptutorial.com
Mis 562 Success Begins / snaptutorial.comWilliamsTaylor42
 
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docxLab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docxsmile790243
 
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docxMSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docxgilpinleeanna
 
CIS 247C iLab 4 of 7: Composition and Class Interfaces
CIS 247C iLab 4 of 7: Composition and Class Interfaces  CIS 247C iLab 4 of 7: Composition and Class Interfaces
CIS 247C iLab 4 of 7: Composition and Class Interfaces HomeWork-Fox
 
Has Many And Belongs To Many
Has Many And Belongs To ManyHas Many And Belongs To Many
Has Many And Belongs To Manyguest80d303
 
1 Goals. 1. To use a text file for output and later for in.docx
1 Goals. 1. To use a text file for output and later for in.docx1 Goals. 1. To use a text file for output and later for in.docx
1 Goals. 1. To use a text file for output and later for in.docxhoney690131
 
How to develop a gateway service using code based implementation
How to develop a gateway service using code based implementationHow to develop a gateway service using code based implementation
How to develop a gateway service using code based implementationnitin2517
 
Cis247 i lab 5 inheritance
Cis247 i lab 5 inheritanceCis247 i lab 5 inheritance
Cis247 i lab 5 inheritancesdjdskjd9097
 
has_many_and_belongs_to_many
has_many_and_belongs_to_manyhas_many_and_belongs_to_many
has_many_and_belongs_to_manytutorialsruby
 
has_many_and_belongs_to_many
has_many_and_belongs_to_manyhas_many_and_belongs_to_many
has_many_and_belongs_to_manytutorialsruby
 
Cis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universityCis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universitylhkslkdh89009
 
e computer notes - Subqueries
e computer notes - Subqueriese computer notes - Subqueries
e computer notes - Subqueriesecomputernotes
 

Similar to Practice create procedure (20)

keep it simple pls Create a project named labExamCCCS221 containing fo.docx
keep it simple pls Create a project named labExamCCCS221 containing fo.docxkeep it simple pls Create a project named labExamCCCS221 containing fo.docx
keep it simple pls Create a project named labExamCCCS221 containing fo.docx
 
33.docxSTEP 1 Understand the UML Diagram Analyze and under.docx
33.docxSTEP 1 Understand the UML Diagram Analyze and under.docx33.docxSTEP 1 Understand the UML Diagram Analyze and under.docx
33.docxSTEP 1 Understand the UML Diagram Analyze and under.docx
 
Oracle - Program with PL/SQL - Lession 09
Oracle - Program with PL/SQL - Lession 09Oracle - Program with PL/SQL - Lession 09
Oracle - Program with PL/SQL - Lession 09
 
Cis 407 i lab 5 of 7
Cis 407 i lab 5 of 7Cis 407 i lab 5 of 7
Cis 407 i lab 5 of 7
 
MIS 562 help Successful Learning/Snaptutorial
MIS 562 help Successful Learning/SnaptutorialMIS 562 help Successful Learning/Snaptutorial
MIS 562 help Successful Learning/Snaptutorial
 
MIS 562 help A Guide to career/Snaptutorial
MIS 562 help A Guide to career/SnaptutorialMIS 562 help A Guide to career/Snaptutorial
MIS 562 help A Guide to career/Snaptutorial
 
Mis 562 Massive Success - snaptutorial.com
Mis 562 Massive Success - snaptutorial.comMis 562 Massive Success - snaptutorial.com
Mis 562 Massive Success - snaptutorial.com
 
Mis 562 Success Begins / snaptutorial.com
Mis 562  Success Begins / snaptutorial.comMis 562  Success Begins / snaptutorial.com
Mis 562 Success Begins / snaptutorial.com
 
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docxLab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
 
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docxMSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
 
CIS 247C iLab 4 of 7: Composition and Class Interfaces
CIS 247C iLab 4 of 7: Composition and Class Interfaces  CIS 247C iLab 4 of 7: Composition and Class Interfaces
CIS 247C iLab 4 of 7: Composition and Class Interfaces
 
Angularjs Live Project
Angularjs Live ProjectAngularjs Live Project
Angularjs Live Project
 
Has Many And Belongs To Many
Has Many And Belongs To ManyHas Many And Belongs To Many
Has Many And Belongs To Many
 
1 Goals. 1. To use a text file for output and later for in.docx
1 Goals. 1. To use a text file for output and later for in.docx1 Goals. 1. To use a text file for output and later for in.docx
1 Goals. 1. To use a text file for output and later for in.docx
 
How to develop a gateway service using code based implementation
How to develop a gateway service using code based implementationHow to develop a gateway service using code based implementation
How to develop a gateway service using code based implementation
 
Cis247 i lab 5 inheritance
Cis247 i lab 5 inheritanceCis247 i lab 5 inheritance
Cis247 i lab 5 inheritance
 
has_many_and_belongs_to_many
has_many_and_belongs_to_manyhas_many_and_belongs_to_many
has_many_and_belongs_to_many
 
has_many_and_belongs_to_many
has_many_and_belongs_to_manyhas_many_and_belongs_to_many
has_many_and_belongs_to_many
 
Cis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universityCis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry university
 
e computer notes - Subqueries
e computer notes - Subqueriese computer notes - Subqueries
e computer notes - Subqueries
 

Practice create procedure

  • 1. 1. Create and invoke the ADD_JOB procedure and consider the results. a. Create a procedure called ADD_JOB to insert a new job into the JOBS table. Provide the ID and title of the job, using two parameters. b. Compile the code, and invoke the procedure with IT_DBA as job ID and Database Administrator as job title. Query the JOBS table to view the results. c. Invoke your procedure again, passing a job ID of ST_MAN and a job title of Stock Manager. What happens and why? 2. Create a procedure called UPD_JOB to modify a job in the JOBS table. a. Create a procedure called UPD_JOB to update the job title. Provide the job ID and a new title, using two parameters. Include the necessary exception handling if no update occurs. b. Compile the code; invoke the procedure to change the job title of the job ID IT_DBA to Data Administrator. Query the JOBS table to view the results. Also check the exception handling by trying to update a job that does not exist (you can use job ID IT_WEB and job title Web Master).
  • 2. 3. Create a procedure called DEL_JOB to delete a job from the JOBS table. a. Create a procedure called DEL_JOB to delete a job. Include the necessary exception handling if no job is deleted. b. Compile the code; invoke the procedure using job ID IT_DBA. Query the JOBS table to view the results. Also, check the exception handling by trying to delete a job that does not exist (use job ID IT_WEB). You should get the message you used in the exception- handling section of the procedure as output. 4. Create a procedure called QUERY_EMP to query the EMPLOYEES table, retrieving the salary and job ID for an employee when provided with the employee ID. a. Create a procedure that returns a value from the SALARY and JOB_ID columns for a specified employee ID. Use host variables for the two OUT parameters salary and job ID. b. Compile the code, invoke the procedure to display the salary and job ID for employee ID 120. c. Invoke the procedure again, passing an EMPLOYEE_ID of 300. What happens and why?