T-SQL version for MySQL?

  • Thread starter WWGD
  • Start date

WWGD

Science Advisor
Gold Member
4,137
1,726
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.
 
10,334
3,866
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.
 

harborsparrow

Gold Member
523
102
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:

pasmith

Homework Helper
1,667
369
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.
 
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!
 
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.
 

harborsparrow

Gold Member
523
102
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.
 
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.
 
Even Microsoft calls it that:

https://support.office.com/en-us/article/access-sql-basic-concepts-vocabulary-and-syntax-444d0303-cde1-424e-9a74-e8dc3e460671

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

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.
 

WWGD

Science Advisor
Gold Member
4,137
1,726
Well, this seems to be going nowhere, if I may. Each of you have different experiences. Thanks to both for your input.
 

harborsparrow

Gold Member
523
102
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.
 

Want to reply to this thread?

"T-SQL version for MySQL?" You must log in or register to reply here.

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top