kasenwilliams6187 kasenwilliams6187
  • 09-10-2017
  • Business
contestada

When inserting a new printer, check that the model number exists in product?

Respuesta :

ahmedishaal ahmedishaal
  • 21-10-2017

We write this trigger  in Oracle SQL in a following way;

CREATE TRIGGER NewPrinterTrigger 

AFTER INSERT ON Printer 

REFERENCING 

  NEW ROW AS NewRow, 

  NEW TABLE AS NewStuff 

FOR EACH ROW 

WHEN (NOT EXISTS (SELECT * FROM Product  

       WHERE Product.model = NewRow.model)) 

DELETE FROM Printer 

  WHERE (model, color, type, price) IN NewStuff; 

Answer Link

Otras preguntas

A mutation occurs in a heart cell of a developing squirrel. the mutation disrupts the formation of a certain protein. what will most likely happen to the squirr
what does the line 2x + 7 = 7 look like?
Jillian’s school is selling tickets for a play. The tickets cost $10.50 for adults and $3.75 for students. The ticket sales for opening night totaled $2071.50.
Which, if any, of these mirrors can produce a real image?
I need help please help me
find (2x^2-4)-(5x^2+2)+(7x^2-5)
I need help please help me
The widespread use of mobile devices such as tablets has resulted in employees bringing their own devices into the workplace and connecting the devices to compa
What was the full extent of Alexander's empire before his death?
Political candidates are notorious for appealing to the different beliefs and values of groups of potential voters in different areas of the country. these poli