Question
Write a SQL trigger (in PostgresSQL) to carry out the following action: On delete of an account, for each customer-owner of the account, check if
Write a SQL trigger (in PostgresSQL) to carry out the following action:
On delete of an account, for each customer-owner of the account, check if the owner has any remaining accounts, and if she does not, delete her from the depositor relation. You must submit both your trigger function, and your trigger definition.
Use this for TRIGGER DEFINTION explanation (will submit new for trigger function)
Database Schema:
branch ( b ranch_name, branch_city, assets )
customer ( I D, customer_name, customer_street, customer_city )
loan ( l oan_number, branch_name, amount )
borrower ( I D, l oan_number )
account ( a ccount_number, branch_name, balance )
depositor ( I D, a ccount_number )
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started