8

Possible Duplicate:
Differences Between MySql and MS SQL

What is the key difference between MySQL and SQL Server from the SQL language perspective. The reason why I am asking is that I need to quickly master some basic SQL knowledge and need to find a book to start with.

I find this one through amazon.com Learning SQL, 2nd Edition, however, this book is for MySQL. All other books for MS SQL are big one that cannot be finished in a short time.

So, it is fine I just grab a MySQL book and later I can easily transfer to MS SQL world or I should immediately go into MS SQL Server?

// update the title based on the comments ///

DineshDB
  • 5,998
  • 7
  • 33
  • 49
q0987
  • 34,938
  • 69
  • 242
  • 387
  • Well what's the different between GCC and the C or C++ standards? Extensions, sometimes missing pieces, etc. – malkia May 25 '11 at 21:19
  • Once you become comfortable with MySQL it will be pretty easy to transition to MsSQL. If all you plan on using is MsSQL though, might as well start there. – Robert May 25 '11 at 21:19
  • 1
    It seemed clear to me that you meant "what is the difference between MySQL and Microsoft SQL Server" as opposed to asking how MySQL deviates from the SQL language. If this is not the case, please reverse my edits. For your reference, Microsoft's database product is called "Microsoft SQL Server" or "SQL Server", and you should refer to it as such to avoid confusion. – user229044 May 25 '11 at 21:20
  • 1
    Learn MySQL, then learn MS SQL: that will give you a feel of the differences between databases and a broader perspective on the field. Just don't speak to your colleagues about SQL starting every sentence with "ah, but in MySQL..." – Fred Foo May 25 '11 at 21:20
  • MySQL doesn't have ROW_NUMBER() and friends - which makes a lot of queries painful! – Will A May 25 '11 at 21:45
  • @q0987, Migrating from MySQL to MSSQL will give you lots and lots of headaches. Better to start with PostgreSQL easier path to MSSQL. – Johan May 25 '11 at 22:36

2 Answers2

8

The following links might help you out.

Note that the two are very different.
If you want to make your live easy, use PostgreSQL, the gap between that and SQL-server is much smaller.

Difference between MySQL and MSSQL

From microsoft and mysql respectively:
http://technet.microsoft.com/en-us/library/cc966396.aspx
http://www.mysql.com/why-mysql/white-papers/mysql_wp_mssql2mysql.php (login required sorry)

On stackoverflow: Differences between MySQL and SQL Server

Difference between PostgreSQL and MySQL

http://www.wikivs.com/wiki/MySQL_vs_PostgreSQL

Difference between postgreSQL and MSSQL

On SO: https://stackoverflow.com/questions/907908/postgres-to-sql-server
and: https://stackoverflow.com/questions/4630891/tips-for-sql-server-developer-picking-up-postgresql

Diff between all three :-)
http://www.postgresonline.com/journal/archives/51-Cross-Compare-of-SQL-Server,-MySQL,-and-PostgreSQL.html
or http://troels.arvin.dk/db/rdbms/

Community
  • 1
  • 1
Johan
  • 74,508
  • 24
  • 191
  • 319
  • It depends which parts of the MySQL "feature" set you use; if you set the options to require strictness, then it's much closer to the standard. If you use backticks around names and double quotes around strings, it's always going to be difficult :-/ – El Yobo May 25 '11 at 22:37
  • I tend to agree about Postgres though; it gives you far fewer ways to shoot yourself in the foot, in regards to standards compliance and in general. – El Yobo May 25 '11 at 22:38
  • @El Yobo, backticks and double quotes are the least of your worries. What about the fact that `group by` can be added to any query in MySQL but will generate errors in almost all other SQL flavors in many cases. – Johan May 27 '11 at 14:31
  • Yeah, MySQL's group by is certainly weird, but probably less common in your queries than using strings (and therefore quotes) :) – El Yobo May 27 '11 at 14:40
  • @El Yobo, you're missing the point. The quotes issue is a simple search and replace. Other issues of which the `group by` is just an example will require hours and hours of debugging and rethinking. – Johan May 27 '11 at 15:15
  • Searching for group by statements is probably easier than searching for quotes, given that your code will almost certainly contain many quotes in non-SQL contexts and few, if any, `group by`s in non-SQL contexts. Other subtle differences are likely to exist between any given pair of RDBMSs, I'm not sure that (aside from these obvious issues) Postgres is better than MySQL in this regard. Did you have some documentation which suggests this? In my personal experience I've found that most SQL works on MySQL, Postgres and MSSQL. – El Yobo May 28 '11 at 02:52
  • Your answer is outdated by now (2017), but one of the links you provided was already outdated when you posted it: the technet link is to a 2001 article, which was already 10 years old when you posted your answer and contains VERY outdated information! – Mark Aug 28 '17 at 09:57
0

This might be a good tutorial to start with SQL - http://philip.greenspun.com/sql/ (rather old, but valid) - though it points more to Oracle, but MySQL is mentioned there.

malkia
  • 1,389
  • 13
  • 12