They list the implementation language for many systems, e.g. for Oracle: http://db-engines.com/en/system/Oracle
Lines of code are typically not disclosed by the vendors; could be done for open-source databases, but then it's not obvious what really should be counted (eg. third party libraries/frameworks).