What database engine does Bitcoin and other top altcoins use? I'm curious to what database engine does Bitcoin and other altcoins use to store their blockchain data. Do they all support sql queries or is it something else?

The main ones I'd like to know are:

Bitcoin, Litecoin, Monero, Ethereum, Dash, Ripple, Factom, NXT, and other ones.
It depends on the implementation. The network itself does not have a database engine. Bitcoin Core and software derived from it (most altcoin software is derived from Core) uses LevelDB to index the blockchain and store the chainstate data (UTXO set, current best block, etc.). It uses BerkeleyDB for the wallet.

However different implementations can use whatever database engine they want. For example, Armory uses LMDB for storing block indexes and other chainstate data.