1 views
23 Jan 2026
In Customers, automatically trim and lowercase email before insert....
0 views
23 Jan 2026
After inserting into Orders, insert a row into AuditLog(table_name, row_id, action)....
0 views
23 Jan 2026
Stop INSERT and UPDATE if Products.price ...
1 views
23 Jan 2026
On update of Orders, set updated_at to current timestamp automatically....
0 views
23 Jan 2026
When a new OrderItems row is inserted, decrement Inventory.qty....
0 views
23 Jan 2026
Block deleting an order if any payment exists for that order. Use a BEFORE DELETE trigger on Orders and check Payments....
0 views
23 Jan 2026
On Employees salary update, insert into SalaryAudit(emp_id, old_salary, new_salary, changed_at)....
0 views
23 Jan 2026
Customers(customer_id, code). On insert, if code is null, set it as 'C' + customer_id....
0 views
23 Jan 2026
Maintain DailySales(day, amount). After insert into Orders, update DailySales for that date....
0 views
23 Jan 2026
Coupons(code, is_active). Before INSERT, if the same code already exists with is_active=1, then block the insert....
0 views
23 Jan 2026
Before inserting OrderItems, ensure Inventory has enough qty for that product. If stock is not enough, raise an error to stop the insert....
0 views
23 Jan 2026
On update of OrderItems.qty, adjust Inventory by the difference....
1 views
23 Jan 2026
Before updating Employees.salary, block the update if the new salary is less than 80% of the old salary....
0 views
23 Jan 2026
Instead of physically deleting a customer, do a soft delete: set is_active=0 and stop the DELETE. Use a BEFORE DELETE trigger to enforce this rule....
0 views
23 Jan 2026
When a customer row is deleted, copy it into DeletedCustomers(customer_id, name, deleted_at) before deletion....