What is the T-SQL version for MySQL?

  • Thread starter Thread starter WWGD
  • Start date Start date
  • Tags Tags
    Mysql
Click For Summary

Discussion Overview

The discussion revolves around the procedural language capabilities of MySQL in comparison to T-SQL used in SQL Server and PL/SQL used in Oracle. Participants explore the nature of SQL as a standard and how different database systems implement their own variations, including the existence of stored procedures in MySQL.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Conceptual clarification

Main Points Raised

  • Some participants inquire about whether MySQL has a procedural language similar to T-SQL or PL/SQL, with one suggesting PHP, which is clarified as a separate programming language.
  • It is noted that SQL is an ANSI standard, but each database system implements it differently, leading to variations in syntax and capabilities.
  • MySQL introduced support for stored procedures in version 8, and there is no distinct name for its procedural language; it utilizes a "compound statement" for procedure bodies.
  • Some participants assert that MySQL, Access, and SQL Server utilize T-SQL, while Oracle uses PL/SQL, arguing against the existence of "Access SQL" as a separate entity.
  • Others challenge this view, stating that Access SQL is recognized as a distinct version of SQL, with differences in capabilities and syntax compared to T-SQL.
  • Disagreement arises regarding the terminology used to describe SQL variations, with some insisting on the distinction between Access SQL and T-SQL, while others argue they are fundamentally the same due to their underlying engine.
  • One participant references Microsoft documentation to support the existence of Access SQL, while another emphasizes that the core SQL language remains consistent across different implementations.

Areas of Agreement / Disagreement

Participants generally disagree on the terminology and classification of SQL variations, particularly regarding the existence and definition of Access SQL. There is no consensus on whether Access SQL should be considered a distinct language or simply a variant of T-SQL.

Contextual Notes

Limitations include varying interpretations of SQL terminology and the lack of a universally accepted definition for Access SQL versus T-SQL. The discussion reflects personal experiences and perspectives, which may not align with formal definitions or standards.

WWGD
Science Advisor
Homework Helper
Messages
7,798
Reaction score
13,098
Hi,
Just curious as to what, if any procedural language MySQL extends to, in the way SQL Server's SQL extends to T-SQL, Oracle SQL extends to PL/SQL? Is it PHP? Sorry, could not get a clear answer in a search.
 
Technology news on Phys.org
SQL is SQL. Vendors might extend SQL with a few features hoping to lock users into their version or in anticipation of a standards change. The SQL variations you mention are vendor extended SQLs designed to work with their database engine.

PHP is a programming language for web applications. Sometimes these applications need to get data from a backend SQL database and so the PHP code might have SQL embedded within the program. This is a common strategy employed by many languages that use ODBC or JDBC api to talk to a database engine.
 
  • Like
Likes   Reactions: WWGD
I'm not entirely sure that I understand the question.

SQL is an ANSI (American National Standards Institute) standard; it is a "virtual" language which does not actually exist. The SQL "standard" has been implemented individually for each relational database management system that exists; thus, MySQL, T-SQL, Oracle SQL, Access SQL, and PL/SQL are each different programming language implementations. They may each contain most, but not all, of the ANSI standard capabilities (or they couldn't really be called SQL at all) but they are not guaranteed to be alike in syntax or even capability. Further, the version of T-SQL (just for example) can vary according to the version of SQL database that is being programmed. I have extensively used T-SQL and Access SQL. Both are from Microsoft, but they have substantial differences which can be quite annoying.

MySQL is the specific version of SQL implemented for the MySQL database.
 
Last edited:
  • Like
Likes   Reactions: sysprog and jedishrfu
WWGD said:
Hi,
Just curious as to what, if any procedural language MySQL extends to, in the way SQL Server's SQL extends to T-SQL, Oracle SQL extends to PL/SQL? Is it PHP? Sorry, could not get a clear answer in a search.

MySQL introduced support for stored procedures in version 8. There is no separate name for this procedural language.

The syntax for CREATE PROCEDURE is documented at https://dev.mysql.com/doc/refman/8.0/en/create-procedure.html.

The actual body of the procedure is a "compound statement", the syntax for which (including flow control statements) is documented at https://dev.mysql.com/doc/refman/8.0/en/sql-syntax-compound-statements.html.

There is an ISO standard for SQL stored procedures called SQL/PSM.
 
  • Like
Likes   Reactions: WWGD and harborsparrow
harborsparrow said:
MySQL, T-SQL, Oracle SQL, Access SQL, and PL/SQL

MySQL, Access, and Microsoft SQL server uses T-SQL (Transact-SQL) while Oracle uses PL/SQL (Procedural). There's no such thing as "Access SQL" or "Oracle SQL". Oracle, Access, MySQL, etc., are the DB engines (Relational, Object Oriented Relational, etc.) that utilizes the type of standardized SQL flavor (i.e., T-SQL or PL/SQL).

Each DB engine will most likely have specific commands in SQL form that pertain just to that specific engine.

Each platform has their pro's and cons.

As mentioned, PHP (and other languages, such as Classic VB, C++, any .NET language, etc.) can all utilize databases via a connector of some sort driver (JDBC, ODBC, DSN's, etc.).

Here's an article that will explain the differences between PL/SQL and T-SQL: https://www.seguetech.com/microsoft-sql-server-vs-oracle-same-different/

Hope that helps!
 
  • Like
Likes   Reactions: WWGD
pasmith said:
MySQL introduced support for stored procedures in version 8. There is no separate name for this procedural language.

The syntax for CREATE PROCEDURE is documented at https://dev.mysql.com/doc/refman/8.0/en/create-procedure.html.

The actual body of the procedure is a "compound statement", the syntax for which (including flow control statements) is documented at https://dev.mysql.com/doc/refman/8.0/en/sql-syntax-compound-statements.html.

There is an ISO standard for SQL stored procedures called SQL/PSM.

Stored Procedures aren't only a PL/SQL thing. MS SQL also supports them and (like MySQL), it's a strictly T-SQL environment.
 
elusiveshame said:
There's no such thing as "Access SQL" or "Oracle SQL". Oracle, Access, MySQL, etc., are the DB engines ...that utilizes the type of standardized SQL flavor (i.e., T-SQL or PL/SQL).

Each DB engine will most likely have specific commands in SQL form that pertain just to that specific engine.

I'm sorry to disagree--elusiveshame seems to be splitting hairs. In the world where I worked for decades, Access SQL very much exists as a distinct entity. Usually, when people say T-SQL, they mean the language used for SQL Server, and when they say Access SQL, they mean the language used for Microsoft Access.

And those two languages differ both in capabilities (Access is much more limited) and syntax.
 
harborsparrow said:
I'm sorry to disagree--elusiveshame seems to be splitting hairs. In the world where I worked for decades, Access SQL very much exists as a distinct entity. Usually, when people say T-SQL, they mean the language used for SQL Server, and when they say Access SQL, they mean the language used for Microsoft Access.

And those two languages differ both in capabilities (Access is much more limited) and syntax.

I'm not splitting hairs at all. I've never in my professional career (20 years) have heard any DBA, IT Professional, or Microsoft refer it as "Access SQL". The limit falls on Access due its foundation. It's still T-SQL, just like VBA is still Visual Basic.
 
  • #10
harborsparrow said:
Even Microsoft calls it that:

https://support.office.com/en-us/ar...d-syntax-444d0303-cde1-424e-9a74-e8dc3e460671

And if you Google "Access SQL", you'll get well over a million results.

https://en.wikipedia.org/wiki/Microsoft_Jet_Database_Engine
Access uses MS JET engine, which uses T-SQL. I've never heard a Microsoft rep, instructor, or technician ever refer to it as "Access SQL".

I could also write my own interface that handles forms like Access does, that uses JET, and call it ElusiveDB and ElusiveSQL. ElusiveSQL would pretty much be identical to Access SQL because of JET. You can slap any pretty label on it, but it's still T-SQL.

That's not splitting hairs since there's truly very few types of SQL (the most common being T-SQL and PL/SQL).

If you know T-SQL, you pretty much know any DBMS that uses any T-SQL based engine. Likewise for PL/SQL.

Access, MS SQL Server, MySQL, MariaDB, etc. all use a T-SQL engine, so aside from the platform specific differences, if you know T-SQL, you'll have zero issues working with any of these kinds of platforms.
 
  • #11
Well, this seems to be going nowhere, if I may. Each of you have different experiences. Thanks to both for your input.
 
  • #12
I don't care what you call the language that targets SQL Server, or the language that targets Microsoft Access. The point I am trying to make is that they are different, VERY different, versions of SQL, and calling them both the same thing is incorrect and misleading.
 

Similar threads

  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 51 ·
2
Replies
51
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
25K