I am doing a bit of queries in Python on the large database to obtain some stats from the database. I would like these stats to stay in-memory so other programs may use them without seeing a database.

I believed of methods to structure them, and after trying to setup some complicated nested dictionaries, I recognized that the good representation could be an SQL table. I'd rather not keep data into the persistent database, though. What are the in-memory implementations of the SQL database that supports querying the information with SQL syntax?

SQLite3 might work. The Python interface does support the in-memory implementation the SQLite3 C API offers.

In the spec:

You may also give you the special title :memory: to produce a database in RAM.

It is also relatively cheap with transactions, based on your work.

I suppose, SQLite3 would be the smartest choice then.

If at all possible, have a look at memcached. (for key-value pair, lighting fast!)

UPDATE 1:

HSQLDB for SQL Like tables. (no python support)

You may make use of a database like SQLite. It isn't as it happens in memory, but it's fairly light and could be completely outside of your primary database.