Forum Academy Marketplace Showcase Pricing Features

Counter database records and write to another table

I have 2 tables:
Here is a description of some fields:
Table topics:
Description, text.
sale, number.
purchase, number.
Location, number.
Total_sale, number,
Total_Purchase, number.
Total_Lease, Number.
Grand total, number.

Vehicles table.
Description, text.
Highlighter.
Template, text.
topic, text.

On the vehicle registration page, I have a Dropdown with the options, sale, purchase and lease.
Another Dropdown with models, Honda Civic, Honda CR-V, Honda Fit, Honda City.

I need to save the sum of the results found in the other table in a table.

What I need to do is this.
Count the records in the vehicles table and store them in the topics table to build a report as follows:

Model For Sale For Purchase For Lease
Honda Civic 20 Vehicles 15 Vehicles 10 Vehicles
Honda Fit 10 Vehicles 5 Vehicles 20 Vehicles

General total of registered vehicles: 80 vehicles

Thanks,
Dirceu M. Azevedo

Maybe reading this could bring you closer to your solution: How to Use the Count Operator | Bubble