Best Book to Learn SQL?

What is the best book I can learn SQL?

I learned it at school and we didn't really have a book. Our teachers recommended one by Rick F. van der Lans, so you can look him up in case you want to. I think people that used it were pretty happy about it.

But when learning, you'll want to practice it, so you might want to find a book that has a sample database included somehow. In a sense it's just like programming, you'll have to do it in order to really get it.

EDIT: found a book by him. It seems like it actually helps you setting up a practice database in MySQL, so that's good. I don't know if you want to spend 50 dollars though (I'm guessing you're from the US) and it was released in 2006, so it's quite old, but it shouldn't matter that much.

We had this book when I was taking a Database class in school:

It's got a lot of the theory behind databases; I don't recall using it that much except for studying for tests. I use a database (PostgreSQL) for work all the time now. Honestly for syntax as such Google is about as good as any textbook. Also the exact syntax will vary some depending on which database you are using(MS SQL Server, PostgreSQL, MySQL, etc...).

I'd say find some lecture videos on the subject to understand the concepts and then download one of the database servers and learn it hands on. If you're familiar with a programming language make some program in it that stores data in your database and then retrieves it.

Which RDBMS will you be using. Learning the ANSI standard SQL get's you so far but most database engines have their own flavour. I have a couple of books that are good for helping to transistion code from PL-SQL to T-SQL. 'The Complete Reference SQL' by McGraw Hill.

If you are working within Windows and .Net then you most likely need to learn T-SQL which is used by Microsoft SQL Server. Look for books written by Itzik Ben-Gan http://tsql.solidq.com/

Also for T-SQL Ed-X have the course 'Querying with Transact-SQL' which I can recommend.

If you are just starting out and don't yet know which flavour you need to learn start with Codecademy SQL course. They also now have a more advanced one too.

Good luck - people will still be writing SQL queries for years to come, it's a useful skill to have.

I strongly recommend Abraham Silberschatz book which is “Database system concepts”. its a great book for self studying , no need to do a single additional google search or anything . it goes through all the concepts of database from the very beginning to advanced sql query structures ,with hundreds of useful examples and queries along with their full answers

and some of the other SQL Books are:

1: Head First SQL
2: SQL CookBook
3: SQL All in One for Dummies
4: Sams Tech SQL in 10 Mins
5: SQL Practice Problems