Task 2 Stored PL/SQL procedure Implement a stored PL/SQL procedure PARTSUPPLIER that lists information about the supplier key and supplier name supplying parts. The procedure first computes the total number of suppliers supplying the specified part. The procedure then extracts the supplier's information supplying the specified part. The information to be displayed include the part key, part name, the supplier key and the supplier's name. An example of a segment of the output for the list of suppliers supplying a specified part (part 59396) is as follow: part key: 59396, orange cream sandy lavender drab Number of suppliers supplying the part: 4 supplier Key 166 Supplier#000000166 935 Supplier#000000935 1704 Supplier#000001704 2397 Supplier#000002397 supplier Name It is up to you to decide if you want to handle exception in your procedure. Deliverables Submit your spooled file solution2.Ist (or solution2.pdf) that contains your SQL script and the output from the execution of the script. The report must have no errors related to the implementation of your task and it must list all PL/SQL and SQL statements processed. Remember to set ECHO option of SQL*Plus to ON!
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
![Task 2
Stored PL/SQL procedure
Implement a stored PL/SQL procedure PARTSUPPLIER that lists information
about the supplier key and supplier name supplying parts. The procedure first
computes the total number of suppliers supplying the specified part. The
procedure then extracts the supplier's information supplying the specified part.
The information to be displayed include the part key, part name, the supplier
key and the supplier's name. An example of a segment of the output for the
list of suppliers supplying a specified part (part 59396) is as follow:
part key: 59396, orange cream sandy lavender drab
Number of suppliers supplying the part: 4
supplier Key
166 Supplier#000000166
935 Supplier#000000935
1704 Supplier#000001704
2397 Supplier#000002397
supplier Name
It is up to you to decide if you want to handle exception in your procedure.
Deliverables
Submit your spooled file solution2.lst (or solution2.pdf) that contains your SQL script
and the output from the execution of the script. The report must have no errors
related to the implementation of your task and it must list all PL/SQL and SQL
statements processed.
Remember to set ECHO option of SQL*Plus to ON!](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fdfef1900-6b6b-4241-b7c7-4b23c6e468f2%2F7a0dcc5e-7941-44b7-9a88-a11c3823298c%2F37rfn9u_processed.png&w=3840&q=75)
![Task 3
Stored trigger
Implement a row trigger that enforces the following consistency constraint.
The column c_comment in the relational table CUSTOMER of the TPCHR
benchmark database is defined as 'NOT NULL'. Create a row trigger that
automatically updates the values in the column (c_comment) to 'New customer
was created on <the system date>' if the comment of the newly inserted record
is left as NULL when a new customer is inserted into the relational table
CUSTOMER. Your trigger, once activated, will enforce the consistency constraint
described.
When ready, process the SQL script solution2.sql and record the results of
processing in a file solution2.Ist.
Deliverables
Hand in the SQL script and the report from execution of scripts.
Remember to set ECHO option of SQL*Plus to ON!](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fdfef1900-6b6b-4241-b7c7-4b23c6e468f2%2F7a0dcc5e-7941-44b7-9a88-a11c3823298c%2F1hjd04_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)