Book description
Practical SQL is an approachable and fast-paced guide to SQL (Structured Query Language), the standard programming language for defining, organizing, and exploring data in relational databases. Anthony DeBarros, a journalist and data analyst, focuses on using SQL to find the story within your data. The examples and code use the open-source database PostgreSQL and its companion pgAdmin interface, and the concepts you learn will apply to most database management systems, including MySQL, Oracle, SQLite, and others.*
You’ll first cover the fundamentals of databases and the SQL language, then build skills by analyzing data from real-world datasets such as US Census demographics, New York City taxi rides, and earthquakes from US Geological Survey. Each chapter includes exercises and examples that teach even those who have never programmed before all the tools necessary to build powerful databases and access information quickly and efficiently.
You’ll learn how to:
•Create databases and related tables using your own data
•Aggregate, sort, and filter data to find patterns
•Use functions for basic math and advanced statistical operations
•Identify errors in data and clean them up
•Analyze spatial data with a geographic information system (PostGIS)
•Create advanced queries and automate tasks
This updated second edition has been thoroughly revised to reflect the latest in SQL features, including additional advanced query techniques for wrangling data. This edition also has two new chapters: an expanded set of instructions on for setting up your system plus a chapter on using PostgreSQL with the popular JSON data interchange format.
Learning SQL doesn’t have to be dry and complicated. Practical SQL delivers clear examples with an easy-to-follow approach to teach you the tools you need to build and manage your own databases.
* Microsoft SQL Server employs a variant of the language called T-SQL, which is not covered by Practical SQL.
Table of contents
- Title Page
- Copyright
- About the Author
- Preface to the Second Edition
- Acknowledgments
- Introduction
- Chapter 1: Setting Up Your Coding Environment
- Chapter 2: Creating Your First Database and Table
- Chapter 3: Beginning Data Exploration with SELECT
- Chapter 4: Understanding Data Types
- Chapter 5: Importing and Exporting Data
- Chapter 6: Basic Math and Stats with SQL
-
Chapter 7: Joining Tables in a Relational Database
- Linking Tables Using JOIN
- Relating Tables with Key Columns
- Querying Multiple Tables Using JOIN
- Understanding JOIN Types
- Using NULL to Find Rows with Missing Values
- Understanding the Three Types of Table Relationships
- Selecting Specific Columns in a Join
- Simplifying JOIN Syntax with Table Aliases
- Joining Multiple Tables
- Combining Query Results with Set Operators
- Performing Math on Joined Table Columns
- Wrapping Up
- Chapter 8: Table Design That Works for You
- Chapter 9: Extracting Information by Grouping and Summarizing
- Chapter 10: Inspecting and Modifying Data
- Chapter 11: Statistical Functions in SQL
- Chapter 12: Working with Dates and Times
- Chapter 13: Advanced Query Techniques
- Chapter 14: Mining Text to Find Meaningful Data
-
Chapter 15: Analyzing Spatial Data with PostGIS
- Enabling PostGIS and Creating a Spatial Database
- Understanding the Building Blocks of Spatial Data
- Understanding Two-Dimensional Geometries
- Understanding PostGIS Data Types
- Creating Spatial Objects with PostGIS Functions
- Analyzing Farmers’ Markets Data
- Working with Census Shapefiles
- Performing Spatial Joins
- Wrapping Up
- Chapter 16: Working with JSON Data
- Chapter 17: Saving Time with Views, Functions, and Triggers
- Chapter 18: Using PostgreSQL from the Command Line
- Chapter 19: Maintaining Your Database
- Chapter 20: Telling Your Data’s Story
- Appendix: Additional PostgreSQL Resources
- Index
Product information
- Title: Practical SQL, 2nd Edition
- Author(s):
- Release date: March 2022
- Publisher(s): No Starch Press
- ISBN: 9781718501065
You might also like
book
Practical SQL
"Practical SQL is an approachable and fast-paced guide to SQL (Structured Query Language), the standard programming …
book
Learning SQL, 3rd Edition
As data floods into your company, you need to put it to work right away—and SQL …
video
Learning SQL
Almost 3 Hours of Video Instruction Your complete SQL video course: Master hands-on, real-world skills for …
book
SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, 4th Edition
The #1 Easy, Common-Sense Guide to SQL Queries—Updated with More Advanced Techniques and Solutions Foreword by …