'How to have a row have different auto incrementation for each new foreign key

I need two tables one being Account and the second being Transaction. The account would have a unique id and would be a foreign key inside the Transaction table. Each account would need it's own transaction id's starting from 1.

So account with id of 1 would have transactions with id's starting from 1 and then The next account with an id would have it's own set of transactions with id's starting from 1.

sql


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source