I was asked to find a few references for our people here; folks who are new to SQL or just haven’t used it in a while. Rather than have my notes tied up in email, I figured I’d put them here for all to use. We use both Oracle Database (10g now, 11g soon) and Microsoft SQL Server.
For a good SQL intro/refresher, I would recommend Murach’s SQL Server 2008 for Developers: Training & Reference by Bryan Syverson and Joel Murach. It is, as the title suggests, targeted toward the use of Microsoft SQL Server, but the 90+% of SQL Language features will apply to other SQL-based databases as well.
Another very good resource is Learning SQL, by Alan Beaulieu; this book covers the SQL language as a whole, without being specific to any one implementation.
[added later] As you progress, these also look to be good if you’re interested in learning more about SQL development:
Microsoft SQL Server 2012 T-SQL Fundamentals by Itzik Ben-Gan
Inside Microsoft® SQL Server® 2008: T-SQL Programming (Pro-Developer) by Itzik Ben-Gan (I don’t see a 2012 version available yet.)
For a practice environment, you can download and setup either MS SQL-Server Express or Oracle Express on your computer.
- Microsoft SQL Server Express – 2012 is the new version; we happen to be using using 2008, an express version of which is probably still available if you dig through the site.
- SQL Server 2008 Management Studio Express
- Oracle Express 11g
- SQL Developer
There are some basic differences between Oracle and Microsoft SQL Server, I’d recommend wandering through these if you, like us, will be playing in both worlds:
- Google search for differences between Oracle SQL and Microsoft SQL
- a Stack Overflow discussion about the differences.
- an article on Migrating from Oracle to SQL Server
- articles from Microsoft on Getting started with SQL Server
The first difference that we will see right away (from the StackOverflow question above): Transaction control. In Oracle everything is a transaction and it is not permanent until you COMMIT. In SQL Server, there is (by default) no transaction control. An error half way through a stored procedure WILL NOT ROLLBACK the DDL in previous steps. There are settings that can change it, but this is the default behavior.
Enjoy, and let me know if you have other resources that have worked well for you.