OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

i there a way to make a database table that each record effects other tables?

  • Thread starter Thread starter Besmella Kazimy
  • Start date Start date
B

Besmella Kazimy

Guest
Im making a store system and I need to make one table for inventory, one for customers, and one for sales log.

in the sales table, there will be foreign keys from each inventory and customer's table to indicate which customer bought what item.

Now what Im stuck with is, is it possible to insert records in the sales table and decrease the quantity of bought-out items automatically from the inventory table?

is there any kind of function in SQLAlchemy that allows me to do that? Or is there any kind of table joining that does it?

or shall I do it manually on my own?
<p>Im making a store system and I need to make one table for inventory, one for customers, and one for sales log.</p>
<p>in the sales table, there will be <code>foreign keys</code> from each inventory and customer's table to indicate which customer bought what item.</p>
<p>Now what Im stuck with is, is it possible to <code>insert records</code> in the sales table and decrease the quantity of bought-out items automatically from the inventory table?</p>
<p>is there any kind of function in <code>SQLAlchemy</code> that allows me to do that?
Or is there any kind of table <code>joining</code> that does it?</p>
<p>or shall I do it manually on my own?</p>
 

Latest posts

Top