Hello all,
I need help with part of an assignment that is due Sunday. This is my first week learning mySQL so clear and simple descriptions will be well liked. Here are the instructions.

a)When adding a customer, add the customer's balance times the sales rep's commission rate to the commission for the corresponding sales rep.

B)When updating a customer, add the difference between the new balance and the old balance multiplied by the sales rep's commission rate to the commission for the corresponding sales rep.

c)When deleting a customer, subtract the balance multiplied by the sales rep's commission rate from the commission for the corresponding sales rep.

How do I do this and how will it look in mySQL command line promt?
Thanks for the help.

You are very likely going to be ignored as this is a "do this for me" "question" as opposed to you trying it first and getting help when you get stuck. The purpose of the classes you are taking is to apply what you have learned...

These are pretty straight forward word problems... if you are doing these queries by hand, as a single run call, these should be very simple as they are pretty basic SQL mixed with SQL Math.

It looks like all of them will require some sort of join between a customer table and a sales rep table. Perhaps you could work on getting the data first, then do the math after...

if you are indeed doing triggers on your first week of SQL, then this page will help you as it has a nice example as the first comment, and you can base your work off of it.

http://dev.mysql.com/doc/refman/5.0/en/triggers.html

If you have specific questions I will be happy to answer them if I am able.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.