What is the T-SQL version for MySQL?
- Thread starter WWGD
- Start date
-
- Tags
- Mysql
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
11 replies · 3K views
Discussion
Physics news on Phys.org
Mentor
- 15,794
- 10,679
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.
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
- 733
- 249
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.
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:
Science Advisor
Homework Helper
- 3,369
- 1,912
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.
elusiveshame
- 170
- 35
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!
elusiveshame
- 170
- 35
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.
harborsparrow
Gold Member
- 733
- 249
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.
elusiveshame
- 170
- 35
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.
harborsparrow
Gold Member
- 733
- 249
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://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.
Last edited:
elusiveshame
- 170
- 35
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.
harborsparrow
Gold Member
- 733
- 249
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
Remembering T-SQL: SET vs SELECT and OBJECT_ID()
- WWGD
- · Replies 1 ·
- Programming and Computer Science
- Replies
- 1
Is T-SQL, Declarative Extensions of SQL Necessary?
- WWGD
- · Replies 1 ·
- Computing and Technology
- Replies
- 1
Trigger error: multi-part identifier deleted.descendant not found in T-SQL
- SlurrerOfSpeech
- · Replies 1 ·
- Programming and Computer Science
- Replies
- 1
How to break down and run a large T-SQL query without generating errors?
- SlurrerOfSpeech
- · Replies 2 ·
- Programming and Computer Science
- Replies
- 2
Does Microsoft have a free version of MySQL?
- Hodgey8806
- · Replies 5 ·
- Computing and Technology
- Replies
- 5