ISBN: 0135182794
Pages: 306
Publisher: Sams – December 20, 2019

This is the best selling SQL book of all time, and is used by individuals, organizations, and as courseware by dozens of academic institutions the world over. This book was born out of necessity. I had been teaching and writing on SQL for a long time, but whenever I was asked to recommend a good book on SQL I found myself somewhat stuck. There are good SQL books out there, but most of them are oriented towards database administrators or developers working within a highly database and SQL-centric world. And as such, most of them are overkill – they tend to provide too much information instead of just what most of us need to know.

This book has a specific audience in mind and was designed to be very different from other offerings out there. Instead of being geared towards DBA’s, this book is designed for real-world developers who write in C/C++ and Objective C, NET. Java, PHP, Python, and any other language. Instead of being designed for folks whose occupation is data manipulation, this book is oriented towards users of other client applications, Word users who need to mail-merge against a back end database, report writer users needing to extract information from corporate data stores, and anyone who needs to manipulate and interact with databases, but for whom database manipulation is not a full-time job.

It does not start with database fundamentals, normalization, relational database design, referential integrity, and security infrastructures. Yes, these issues are covered, but that is not the emphasis or the positioning, Rather, the book starts with the SQL SELECT statement, and then adds filtering, sorting, and so on. Table creation, working with different datatypes, implementing constraints, using stored procedures and triggers, and more are all introduced clearly and methodically in small bite size chucks. The emphasis on getting stuff done, and getting it done quickly helping you be productive as quickly as possible in whatever tool or environment you use.

This fifth edition provides additional examples and tips, adds coverage of several advanced topics, and content specific to IBM DB2 (including DB2 on Cloud), Microsoft SQL Server (including SQL Server Express), MariaDB, MySQL, Oracle (including Oracle Express and the wonderful Oracle Live SQL), SQLite, and PostgreSQL.

Like the prior edition, this edition is printed in color and features color coding in all example source code.

New to this edition is a reader requested enhancement. Many of the lessons now conclude with challenge questions to help you practice and master SQL.

I hope you find that these objectives have been met, and I welcome your feedback. Enjoy.

Chapter listing

  • Introduction
  • 1: Understanding SQL
  • 2: Retrieving Data
  • 3: Sorting Retrieved Data
  • 4: Filtering Data
  • 5: Advanced Data Filtering
  • 6: Using Wildcard Filtering
  • 7: Creating Calculated Fields
  • 8: Using Data Manipulation Functions
  • 9: Summarizing Data
  • 10: Grouping Data
  • 11: Working with Subqueries
  • 12: Joining Tables
  • 13: Creating Advanced Joins

  • 14: Combining Queries
  • 15: Inserting Data
  • 16: Updating and Deleting Data
  • 17: Creating and Manipulating Tables
  • 18: Using Views
  • 19: Working with Stored Procedures
  • 20: Managing Transaction Processing
  • 21: Using Cursors
  • 22: Understanding Advanced SQL Features
  • Appendix A: Sample Table Scripts
  • Appendix B: SQL Statement Syntax
  • Appendix C: Using SQL Datatypes
  • Appendix D: SQL Reserved Words

Challenges

Lessons 2 – 18 contain challenge questions to help you practice and master your SQL. If you are looking for the solutions to these challenges, click here.

Supporting Resources

Lesson 1: Understanding SQL

Lesson 1 lists a range of DBMS options that you can use while learning SQL with this book. To make things easier for you, here are links to some of the options mentioned:

Free options:

Cloud options:

  • Oracle Live SQL is my favorite hosted solution, you get the power of full-blown Oracle DBMS with a really painless setup and a clean work environment.
  • IBM Db2 on Cloud is another great option, one that is powerful and feature rich, but the setup can be complex and intimidating.

Appendix A: Sample Table Scripts

Appendix A describes the database tables used in the examples in this book. You may download database tables or creation scripts here:

Other Editions Of This Title