0

I have following database

  • Customer (customerNO, customerName, address, city, category, custBalance)
  • Product (productNO, label, price, QStock)
  • CustomerOrder (orderNO, orderDate, #customerNO)
  • OrderedProduct (#orderNO, #productNO , orderQuantity )

and want to create these programs

First one is: a stored function called productPerOrder to return the number of products placed for any order its number is given as input.

Second one: a trigger called changeCustomer_Category which should be invoked before any update of customer balance in customer table. Its job is to modify the category of a customer from B2 to B1 and from C2 to C1 when a customer's balance status drops below a certain threshold (-10000).

7
  • 1
    If you run into problems you can ask a specific question here.
    – jarlh
    Commented Nov 24, 2021 at 13:36
  • what is your question? what have you attempted to do on your own?
    – Miguel
    Commented Nov 24, 2021 at 13:59
  • i want the sql for Trigger and Function
    – hala tech
    Commented Nov 24, 2021 at 14:43
  • 1
    @halatech it's your job to write that code, and then come back here when you have code specific problems, then it's OUR job to help you answer those questions. It's not our job to write that code for you. Commented Nov 24, 2021 at 16:23
  • Welcome to the SO Community. The community will help you with your issues, but it has certain expectations of you and it is not a code writing service. You need to spend a few minuets to take the Tour and review How to Ask. In particular you need to post complete table description (ddl), sample data, expected results for that data and what you have written so far. All as text - no images.
    – Belayer
    Commented Nov 24, 2021 at 17:40

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.