What is the T-SQL version for MySQL?

  • Thread starter Thread starter WWGD
  • Start date Start date
  • Tags Tags
    Mysql
Click For Summary
MySQL extends SQL with its own implementation, which includes support for stored procedures introduced in version 8. Unlike SQL Server's T-SQL or Oracle's PL/SQL, MySQL does not have a distinct procedural language name; instead, it uses a syntax for creating procedures that includes compound statements. SQL is standardized by ANSI, but each database management system, including MySQL, SQL Server, and Oracle, implements SQL with variations that can differ in syntax and capabilities. While some argue that terms like "Access SQL" are valid due to their distinct syntax and limitations, others maintain that these variations are fundamentally extensions of T-SQL. The discussion highlights the importance of recognizing the differences between these SQL implementations, as they can significantly impact database management and application development.
WWGD
Science Advisor
Homework Helper
Messages
7,766
Reaction score
12,983
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 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 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 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 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
5K
  • · 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
4K