24
loading...
This website collects cookies to deliver better user experience
PL/pgSQL
was created to incorporate PostgreSQL-specific syntax, which might not make sense in other database systems. Regardless of these dialects, many databases have common syntax due to the ANSI SQL
specification. Similar to JDBC, REST, and many others, ANSI SQL
was created so that vendors (both open source and commercial) can co-operate in a meaningful way. Structured Query Language
itself. The structured nature of SQL is the reason it became so popular and widely adopted. SQL can be roughly split into sections as shown below:SELECT
, FROM
and a WHERE
clause. There are optional ORDER BY
, JOIN
, LIMIT
and GROUP BY
clauses as well.SELECT
, WHERE
, and ORDER BY
, are just the basics that most software developers use in day-to-day development. Let's take a look at how some of the most famous dialects handle these basics and some custom examples around them.TSQL
or Transact SQL is an SQL dialect for the Microsoft SQL Server database. Instead of looking at a function example as we did for PostgreSQL, we will take an example for a normal DQL query. sales
and we want to get the top 10 sales by amount
. A normal SQL query for it would look like -TSQL
syntax.TOP
query and other proprietary syntax offered by SQL Server in the documentation. TSQL
is also Turing Complete similar to PL/Pg SQL
. There is even an example of a language interpreter being completely written in TSQL
, although the language itself is not as complicated as a full-blown programming language.PL/SQL
is Oracle's proprietary database procedural language. It works very similar to other procedural languages. A base structure for this is as follows, 10000
. users
table. This can then be wrapped into a function and then called in a manner similar to our PL/Pg SQL
example. PL/SQL
also qualifies as a Turing complete language and is popularly used in financial institutions, where entire business applications are written on top of it.C
code and hence do not incur any cost as far as compilation is concerned.Death to SQL
. But SQL came back with even more force in the big data world. Here are some examples of the SQL dialects that exist with many big data systems.