Yes, but that is an entirely different use case for a SQL database than what we are discussing here.
Just do it in an SQL database and write the result on the Blockchain
Literally describing LN
reply
LN is a network of SQL databases that have to agree on state, yes.
reply