HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlModerate

How to check what Database Engine is installed on the DataBase server that I have acces to run queries on?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
enginethewhatdatabasethatacceshowserverqueriescheck

Problem

I want to check what type of sql is running on a Datasase server that I can access. I only have access to a web interface and a list of tables.

Through the interface I can run queries on the tables that are present on a list.

How can I get more information about the server and the version that the server is running. I have no idea about the IP or the PORT that the server is running.

I want to know if the server is MySQL, Mircosoft SQL Server, Oracle SQL, Postgre SQL or other sql server.

The website that I am talking about is this one:
w3schools.com SQL editor.

EDIT 2: although for some the command select sqlite_version() works for me it does not work. This is the screenshot of the response.

EDIT 3 :
On Chromium Browser the command is working properly. However on Firefox Browser the command did not work.

I also mention that I am on running Linux.

What do you think could be the reason why on Firefox and on Chrome I get different results ?

Solution

I assume that your web interface lets you issue SQL commands. If so, you can use:

SELECT version();


PostgreSQL

If you are on a PostgreSQL database, you get a response similar to

PostgreSQL 9.6.1 on x86_64-apple-darwin14.5.0, compiled by Apple LLVM version 7.0.0 (clang-700.1.76), 64-bit


MySQL

If you are on a MySQL database, the answer looks like

5.7.12-log


Oracle

If you are on an Oracle database, you'll get an error message:

ORA-00923: FROM keyword not found where expected


(The ORA-xxxx tells you you're on Oracle). To find out which specific version, try:

SELECT banner as "oracle version" from v$version


You'll get a response like:

Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE    11.2.0.2.0  Production
TNS for 64-bit Windows: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production


Microsoft SQL Server

If you're on MS SQL Server, the response will also be an error, and look like:

'version' is not a recognized built-in function name.


In that case, you can try:

SELECT @@version ;


And you'll get, as a response, something looking like:

Microsoft SQL Server 2016 (SP1) (KB3182545) - 13.0.4001.0 (X64)   
    Oct 28 2016 18:17:30   
    Copyright (c) Microsoft Corporation  
    Enterprise Edition (64-bit) on Windows Server 2012 R2 Standard 6.3  (Build 9600: ) (Hypervisor)


SQLite

If you're on a SQLite database, you'll get an error message when you try SELECT version():

could not prepare statement (1 no such function: version)


In that case, you can try:

SELECT sqlite_version()


And the response will look like:

3.14.0

Code Snippets

SELECT version();
PostgreSQL 9.6.1 on x86_64-apple-darwin14.5.0, compiled by Apple LLVM version 7.0.0 (clang-700.1.76), 64-bit
ORA-00923: FROM keyword not found where expected
SELECT banner as "oracle version" from v$version
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE    11.2.0.2.0  Production
TNS for 64-bit Windows: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production

Context

StackExchange Database Administrators Q#163993, answer score: 16

Revisions (0)

No revisions yet.