Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine flavor of SQL being used

Tags:

sql

database

I have a mysterious SQL database presented through a web interface. I tried to show tables; but was told that's not a valid command, so I'm trying to figure out what flavor of SQL this is.

Does anyone know a command that can help identify the flavor of SQL being used? Any pointers would be very helpful!

like image 337
duhaime Avatar asked Oct 23 '25 04:10

duhaime


1 Answers

Not an answer but a comment that doesn't fit in the comments. You can start by trying the following commands and see if one succeeds:

  • Oracle: select * from V$VERSION;
  • DB2: select service_level from sysibmadm.env_inst_info;
  • PostgreSQL: select version();
  • SQL Server: select @@version;
  • MariaDB: select version();
  • MySQL: select version();
  • H2: SELECT H2VERSION() FROM DUAL
  • SQLite: select sqlite_version();
  • Firebird: select rdb$get_context('SYSTEM', 'ENGINE_VERSION') as version from rdb$database;

HyperSQL gives itself away by implementing the BOOLEAN and INTERVAL types.

In Derby you can select from the table sysibm.sysdummy1 (as well as in DB2).

like image 75
The Impaler Avatar answered Oct 25 '25 19:10

The Impaler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!