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

Vince helped the pep club make sandwiches to raise money. He put two sandwiches in each of 30 bags and 5 sandwiches in 26 family bags, and he has 17 sandwiches
There are six rows with 18 chairs in each row. In the center of those chairs for rows of six chairs are brown. The rest of the chairs are blue. How many chairs
To which literary movement did Ambrose Bierce belong? romanticism realism naturalism neoclassicism
Tristan uses 7 stsrs and 9 diamonds to make a design.write two ratios that are equivalent to 7/9
If Taryn and Alistair want to earn an additional $735 each , how many hours will each spend mowing lawns
earth main layers from the center to the outside of the planet
Why was Philip II called Augustus?
why does the president usually urge voters to elect members of the president's own political party to congress
A theocracy is ruled by religious leaders who
A 4.0 kg bird has 8.0 joules of kinetic energy how fast is it flying