Skip to main content
  • Book
  • © 2018

SQL Primer

An Accelerated Introduction to SQL Basics

Apress

Authors:

  • Provides a foundation in the most important language when working with data

  • Focuses on the most used parts of SQL, without getting bogged down in arcane details

  • Teaches database-agnostic SQL that works on almost any database system

Buy it now

Buying options

eBook USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Other ways to access

This is a preview of subscription content, log in via an institution to check for access.

Table of contents (19 chapters)

  1. Front Matter

    Pages i-xvii
  2. An Introduction to SQL

    • Rahul Batra
    Pages 1-9
  3. Getting Your Database Ready

    • Rahul Batra
    Pages 11-24
  4. The Benefit of Constraints

    • Rahul Batra
    Pages 25-36
  5. Operations on Tables

    • Rahul Batra
    Pages 37-46
  6. Writing Basic Queries

    • Rahul Batra
    Pages 47-56
  7. Manipulating Data

    • Rahul Batra
    Pages 57-64
  8. Organizing Your Data

    • Rahul Batra
    Pages 65-74
  9. Doing More with Queries

    • Rahul Batra
    Pages 75-85
  10. Calculated Fields

    • Rahul Batra
    Pages 87-93
  11. Aggregation and Grouping

    • Rahul Batra
    Pages 95-107
  12. Understanding Joins

    • Rahul Batra
    Pages 109-121
  13. Subqueries

    • Rahul Batra
    Pages 123-132
  14. Working in Sets

    • Rahul Batra
    Pages 133-140
  15. Views

    • Rahul Batra
    Pages 141-149
  16. Indexing

    • Rahul Batra
    Pages 151-164
  17. Access Control Statements

    • Rahul Batra
    Pages 165-173
  18. Further Reading

    • Rahul Batra
    Pages 175-178
  19. Database Management Systems and Tools

    • Rahul Batra
    Pages 179-182
  20. A History of SQL and Relational Databases

    • Rahul Batra
    Pages 183-187

About this book

Build a core level of competency in SQL so you can recognize the parts of queries and write simple SQL statements. SQL knowledge is essential for anyone involved in programming, data science, and data management. This book covers features of SQL that are standardized and common across most database vendors. You will gain a base of knowledge that will prepare you to go deeper into the specifics of any database product you might encounter. 

Examples in the book are worked in PostgreSQL and SQLite, but the bulk of the examples are platform agnostic and will work on any database platform supporting SQL. Early in the book you learn about table design, the importance of keys as row identifiers, and essential query operations. You then move into more advanced topics such as grouping and summarizing, creating calculated fields, joining data from multiple tables when it makes business sense to do so, and more. Throughout the book, you are exposed to a set-based approach to the language and are provided a good grounding in subtle but important topics such as the effects of null value on query results.
 
With the explosion of data science, SQL has regained its prominence as a top skill to have for technologists and decision makers worldwide. SQL Primer will guide you from the very basics of SQL through to the mainstream features you need to have a solid, working knowledge of this important, data-oriented language.


What You'll Learn
  • Create and populate your own database tables
  • Read SQL queries and understand what they are doing
  • Execute queries that get correct results
  • Bring together related rows from multiple tables
  • Group and sort data in support of reporting applications
  • Get a grip on nulls, normalization, and other key concepts
  • Employ subqueries, unions, and other advanced features


Who This Book Is For



Anyone new to SQL who is looking for step-by-step guidance toward understanding and writing SQL queries. The book is aimed at those who encounter SQL statements often in their work, and provides a sound baseline useful across all SQL database systems. Programmers, database managers, data scientists, and business analysts all can benefit from the baseline of SQL knowledge provided in this book.





Authors and Affiliations

  • Gurgaon, India

    Rahul Batra

About the author

​Rahul Batra was first introduced to programming in 1996 with GWBASIC, but he did not seriously foray into programming until 2001 when he started learning C++. Along the way, Rahul dabbled in many other languages such as C, Ruby, Perl, Python, and Lisp. He has worked with databases such as PostgreSQL, Sybase ASA, and SQLite. He is passionate about sharing knowledge, especially with those who are just starting out. Rahul currently lives and works in Gurgaon, India.

Bibliographic Information

  • Book Title: SQL Primer

  • Book Subtitle: An Accelerated Introduction to SQL Basics

  • Authors: Rahul Batra

  • DOI: https://doi.org/10.1007/978-1-4842-3576-8

  • Publisher: Apress Berkeley, CA

  • eBook Packages: Professional and Applied Computing, Professional and Applied Computing (R0), Apress Access Books

  • Copyright Information: Rahul Batra 2018

  • Softcover ISBN: 978-1-4842-3575-1Published: 16 June 2018

  • eBook ISBN: 978-1-4842-3576-8Published: 15 June 2018

  • Edition Number: 1

  • Number of Pages: XVII, 194

  • Number of Illustrations: 14 b/w illustrations

  • Topics: Database Management

Buy it now

Buying options

eBook USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Other ways to access