Need the code in PL/SQL for Procedures and Functions for feature 7 below, please provide the answer using varray data type (read the hint highlighted for the feature). we already done with other feature. Please we only need the feature 7 below. The two tables and attributes below are the tables we made and are using for this assignment. URGENT!! ------------------------------------------------------------------------------------------------------- Each feature will be implemented as one or more Oracle PL/SQL procedures/functions. You can make the following assumptions in this project. The database stores information about houses, each with a house ID, address, and zip code. The database stores information about person, including person ID, house ID where the person lives, person name, phone number, and status where 1 means currently tested positive (i.e., the most recent test result is positive), 0 means currently tested negative (i.e., the most recent test result is negative), and null (no test so far so status is unknown). The database stores information about a person's all past tests, including person ID, test date, and result (1 means positive and 0 negative). The database stores information about events (could be gathering, party, etc.). Each event has an event ID, event name, date, and address. The database stores information about a person participated in an event. The database stores information about flights, including flight ID, flight date, flight number (a varchar type e.g., 'DL 345' is a delta 345 flight). The database stores IDs of people on a specific flight. -------------------------------------------------------------------------------------------------------------------------- drop table person_events cascade constraints; drop table pevents cascade constraints; create Table person_events( pid int, eid int, primary key(pid,eid)); insert into person_events values(1,1); insert into person_events values(2,2); insert into person_events values(3,3); create table pevents( eid int, ename varchar (30), edate varchar (30), eadddress varchar (40)); insert into pevents values (1,'House Party', date '2025-8-8','123 CoreyLake Ave MD'); insert into pevents values (2,'Wedding', date '2025-2-8','13 Cikerlook Ave MD'); insert into pevents values (3,'BBQ', date '2025-1-1','122 Greenbelt Ave MD'); -------------------------------------------------------------------------------------------------------------------------------- Each feature will be implemented as one or more Oracle PL/SQL procedures/functions. Use PL/SQL to answer the following questions. Member 4: Feature 7: Enter a list of people attending an event. Hint: use varray data type as input parameter. Input includes event ID and list of person ids. First check whether the event exists. If not print a message saying the event does not exist. Next check each person ID, if it does not exist print a message saying the person does not exist. Next check whether the person id and event id combination are already in person_event table. If so print a message 'No need to insert'. Otherwise insert a row into person_event.
second attempt:
Need the code in PL/SQL for Procedures and Functions for feature 7 below, please provide the answer using varray data type (read the hint highlighted for the feature). we already done with other feature. Please we only need the feature 7 below. The two tables and attributes below are the tables we made and are using for this assignment. URGENT!!
-------------------------------------------------------------------------------------------------------
Each feature will be implemented as one or more Oracle PL/SQL procedures/functions.
You can make the following assumptions in this project.
- The
database stores information about houses, each with a house ID, address, and zip code.
- The database stores information about person, including person ID, house ID where the person lives, person name, phone number, and status where 1 means currently tested positive (i.e., the most recent test result is positive), 0 means currently tested negative (i.e., the most recent test result is negative), and null (no test so far so status is unknown).
- The database stores information about a person's all past tests, including person ID, test date, and result (1 means positive and 0 negative).
- The database stores information about events (could be gathering, party, etc.). Each event has an event ID, event name, date, and address.
- The database stores information about a person participated in an event.
- The database stores information about flights, including flight ID, flight date, flight number (a varchar type e.g., 'DL 345' is a delta 345 flight).
- The database stores IDs of people on a specific flight.
--------------------------------------------------------------------------------------------------------------------------
drop table person_events cascade constraints;
drop table pevents cascade constraints;
create Table person_events(
pid int,
eid int,
primary key(pid,eid));
insert into person_events values(1,1);
insert into person_events values(2,2);
insert into person_events values(3,3);
create table pevents(
eid int,
ename varchar (30),
edate varchar (30),
eadddress varchar (40));
insert into pevents values (1,'House Party', date '2025-8-8','123 CoreyLake Ave MD');
insert into pevents values (2,'Wedding', date '2025-2-8','13 Cikerlook Ave MD');
insert into pevents values (3,'BBQ', date '2025-1-1','122 Greenbelt Ave MD');
--------------------------------------------------------------------------------------------------------------------------------
Each feature will be implemented as one or more Oracle PL/SQL procedures/functions.
Use PL/SQL to answer the following questions.
Member 4: Feature 7: Enter a list of people attending an event. Hint: use varray data type as input parameter. Input includes event ID and list of person ids.
- First check whether the event exists. If not print a message saying the event does not exist.
- Next check each person ID, if it does not exist print a message saying the person does not exist.
- Next check whether the person id and event id combination are already in person_event table. If so print a message 'No need to insert'. Otherwise insert a row into person_event.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images