So, I have 2 tables.
One is books
, that has the following fields.
accno
(Accession number), name
(book name), status
(Issued/Not Issued)
Second is total
, that has the following fields.
name
(book name), count
(Number of books that are 'Not Issued' in the books
table
I have a form that adds books in the books table, and the default status is 'Not Issued'. I also have a form that issued books i.e. it changes the status to 'Issued'. And I have a form that returns the books i.e. it changes the status back to 'Not Issued'.
I'm looking for a trigger that updates the count in the total
table everytime the books
table is updated. Count is the number of books that are available(Not Issued) in the books table, and it is different for different books(book names).
I am totally new to triggers. I have looked arond, but I can't seem to figure a way to implement this.
Any help is appreciated. Thank you.