Question: Please do the PL / SQL code this feature and put it inside a table also as a reference take my feature 2 just like

Please do the PL/SQL code this feature and put it inside a table also as a reference take my feature 2 just like how i did it.
(Feature 2: add a company. Input includes a company name. The procedure does the following:
1) It first checks whether there is a company with the same name as the input, if so prints a message 'company already exists' and stops.
2) If the company does not exist, it inserts a row into the company table with a newly generated company ID (using sequence) and the input company name. It also prints out the new vehicle ID. Delete this before turning in)
-- Drop existing table and cascade constraints
DROP TABLE company CASCADE CONSTRAINTS;
SET SERVEROUTPUT ON;
-- Create sequence for company IDs
CREATE SEQUENCE companySeq START WITH 1;
-- Create company table
CREATE TABLE company(
compID INT NOT NULL,
compName VARCHAR(100) NOT NULL,
PRIMARY KEY (compID)
);
-- Create or replace the procedure for adding companies--
CREATE OR REPLACE PROCEDURE addCompany(
newcompName VARCHAR2
) AS
v_comp_id NUMBER;
BEGIN
BEGIN
SELECT compID INTO v_comp_id FROM company WHERE compName = newcompName;
DBMS_OUTPUT.PUT_LINE('Company already exists.');
EXCEPTION
WHEN NO_DATA_FOUND THEN
SELECT companySeq.NEXTVAL INTO v_comp_id FROM DUAL;
INSERT INTO company (compID, compName)
VALUES (v_comp_id, newcompName);
DBMS_OUTPUT.PUT_LINE('New company ID: '|| v_comp_id);
END;
END;
--Regular Cases--
BEGIN
addCompany('Google');
addCompany('Amazon');
addCompany('Meta');
END;
--Select to verify entries--
SELECT * FROM company;
--Special Cases--
BEGIN
addCompany('Google');
addCompany('Amazon');
END;
--Verfiy companies were not added--
SELECT * FROM company;
(Feature 3: search for job posts. The input includes a keyword, job type (full time or part time), and a state. The procedure does the following:
1) It finds all job posts that are active and the job title or job description has a substring that matches the input keyword, and the job post's state and job type match the input state and job type. The procedure prints out the matching job posts' job post id, associated company name, job title, description, min and max pay, city and state.
2) In case there are no matching job posts, print out 'No job posts found'.
Hint: to match a substring in the procedure, use
where column_name like '%'|| input_keyword ||'%'

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!