The following schema is given (primary keys are bold): ARTWORK (ArtworkCode. Title, Author, BasicAuction Price, FinalSalePrice". NumParticipantingBuyers", FinalBuyerID") OFFER (ArtworkCode, BuyerID, Date, Amount) REQUEST AUCTION ENDING (ArtworkCode. Auction EndingDate, Description) Write the trigger to manage the following activities related to an online auction of artworks. The ARTWORK table contains the list of artworks sold at the auction. The OFFER table contains, for each artwork, a list of the amounts that have been offered by buyers interested in purchasing the artwork. The same buyer can make multiple offers for the same artwork on different dates. A request to end the auction for an artwork is generated (inserting a record into the table REQUEST AUCTION ENDING), If there was no offer for the artwork, the trigger ends with an error. Otherwise, you have to calculate the following information. (1) The final sale price of the artwork, corresponding to the highest amount offered for the artwork, 2) the buyer who offered this amount. Consider that there is only one maximum offer amount for each artwork. 3) The number of different buyers who participated in the auction. You must then update the value of the FinalSalePrice, NumParticipantingBuyers, FinalBuyerID attributes in the ARTWORK table with the calculated Information. INstruction for carrying out the question: Given the following incomplete solution of the trigger, you are asked to complete Part A in bold by specifying the trigger execution mode (before or after) and Part B in bold by specifying the body of the trigger. Use the text box below to provide your solution. Use the raise application_error() function to raise an error. It is not required to specify the parameters passed to the function.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

The following schema is given (primary keys are bold):

ARTWORK (ArtworkCode. Title, Author, BasicAuction Price, FinalSalePrice". NumParticipantingBuyers", FinalBuyerID")

OFFER (ArtworkCode, BuyerID, Date, Amount)

REQUEST AUCTION ENDING (ArtworkCode. Auction EndingDate, Description)

Write the trigger to manage the following activities related to an online auction of artworks. The ARTWORK table contains the list of artworks sold at the auction.

The OFFER table contains, for each artwork, a list of the amounts that have been offered by buyers interested in purchasing the artwork. The same buyer can make multiple offers for the same artwork on different dates.

A request to end the auction for an artwork is generated (inserting a record into the table REQUEST AUCTION ENDING), If there was no offer for the artwork, the trigger ends with an error. Otherwise, you have to calculate the following information.

(1) The final sale price of the artwork, corresponding to the highest amount offered for the artwork,

2) the buyer who offered this amount. Consider that there is only one maximum offer amount for each artwork.

3) The number of different buyers who participated in the auction.

You must then update the value of the FinalSalePrice, NumParticipantingBuyers, FinalBuyerID attributes in the ARTWORK table with the calculated Information.

INstruction for carrying out the question:

Given the following incomplete solution of the trigger, you are asked to complete Part A in bold by specifying the trigger execution mode (before or after) and Part B in bold by specifying the body of the trigger. Use the text box below to provide your solution. Use the raise application_error() function to raise an error. It is not required to specify the parameters passed to the function.

 

create or replace trigger EndingAuction after insert on REQUEST AUCTION ENDING

Part A

Part B

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education