What is the T-SQL version for MySQL?

  • Thread starter WWGD
  • Start date
  • Tags
    Mysql
In summary: 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.
  • #1
WWGD
Science Advisor
Gold Member
7,007
10,463
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
  • #2
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
  • #3
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
  • #4
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
  • #5
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
  • #6
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.
 
  • #7
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.
 
  • #8
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.
 

1. What is T-SQL?

T-SQL stands for Transact-SQL and is a proprietary extension to the SQL language used in Microsoft SQL Server. It is used for querying and managing data in SQL Server databases.

2. What is MySQL?

MySQL is an open-source relational database management system that uses the SQL language. It is commonly used for web applications and is known for its speed, reliability, and ease of use.

3. Is there a T-SQL version for MySQL?

No, T-SQL is specific to Microsoft SQL Server and cannot be used with MySQL. However, MySQL has its own version of SQL called MySQL SQL or MySQL dialect.

4. What is the difference between T-SQL and MySQL SQL?

While both languages are variations of SQL, T-SQL is proprietary to Microsoft SQL Server, while MySQL SQL is open-source and used exclusively with MySQL. They have similar syntax and functionality, but there are some differences in specific commands and functions.

5. Can T-SQL code be converted to MySQL SQL?

Yes, it is possible to convert T-SQL code to MySQL SQL, but it may require some manual modifications, as the two languages have some differences in syntax and functionality. There are also online tools and software available that can assist with the conversion process.

Similar threads

  • Programming and Computer Science
Replies
16
Views
1K
  • Programming and Computer Science
2
Replies
51
Views
4K
  • STEM Academic Advising
Replies
1
Views
680
  • Programming and Computer Science
Replies
16
Views
2K
  • Programming and Computer Science
Replies
1
Views
1K
  • Computing and Technology
Replies
1
Views
1K
  • Programming and Computer Science
Replies
6
Views
3K
  • Programming and Computer Science
Replies
3
Views
1K
Replies
11
Views
1K
  • Computing and Technology
Replies
1
Views
1K
Back
Top