Head First SQL

Book description

What will you learn from this book?

Do you have an abundance of data but don't know how to make sense of it? Do you want to gain useful insights from your data, but you're not sure where to begin? Mining data is a vital, well-paying skill, and SQL provides the most fundamental way to query and manage data. But learning SQL can be intimidating. This thoroughly revised book teaches you SQL fundamentals in a painless and enjoyable manner. With the Head First series' hands-on, conversational style, you'll quickly grasp SQL concepts, then move to intermediate topics, including stored procedures and cloud databases. You'll gain the knowledge, skills, and confidence necessary to get the most out of your data with SQL.

Why does this book look so different?

If you've read a Head First book, you know what to expect: a visually rich format designed for the way your brain works. If you haven't, you're in for a treat. With this book, you'll learn about SQL through a multisensory experience that engages your mind—rather than a text-heavy approach that puts you to sleep.

Publisher resources

View/Submit Errata

Table of contents

  1. Brief Table of Contents (Not Yet Final)
  2. 1. Databases and Tables: Organizing Your Information
    1. Defining your data
    2. Think about your data in categories
    3. Build a table of information
    4. What is SQL?
    5. The anatomy of a table
    6. A table of travel data
    7. BE the table
    8. BE the table Solution
    9. What’s a database?
    10. Databases contain related information
    11. Take command!
    12. Your first SQL commands
    13. Creating a SQL table
    14. Steps for creating a general SQL table
    15. Your table is ready
    16. A selection of common data types
      1. Data types for text
      2. Data types for numbers
      3. Data types for dates and times
      4. A data type for other things
    17. Who am I?
    18. Your table, DESCribed
    19. Changing table properties
    20. Code Magnets
    21. Code Magnets Solution
    22. Dropping and recreating tables
    23. Adding a new column
    24. Hitting your cruising altitude
    25. SQLcross
    26. Your SQL toolbox
    27. Who am I? Solution
    28. SQLcross Solution
  3. 2. Inserting Data: Adding Table Rows
    1. Setting up a database with tables
    2. Checking back in with Abby
    3. Inserting data into tables
    4. Creating your INSERT statement
    5. See your table with SELECT
    6. A new recommendation
    7. Records with missing values
    8. Revisiting your table
    9. Controlling NULLs...
    10. ... and Setting DEFAULTs
    11. Variations on INSERT #1
    12. Variations on INSERT #2
    13. Variations on INSERT #3
    14. A punctuation problem
    15. Unmatched single quotes
    16. INSERT data with single quotes in it
    17. It’s only up from here!
    18. SQLcross
    19. Your SQL toolbox
    20. SQLcross Solution
  4. 3. The Select Statement: Finding Your Information
    1. Searching for a destination
    2. SELECT specific columns
    3. Specify columns... and their order
      1. SELECT specific columns for faster results
    4. An even better SELECT
    5. WHERE to next?
    6. WHERE filters out rows
    7. WHERE results
    8. Finding numeric values
    9. Expanding a numeric search
    10. Short travel times using less than
    11. Comparison Operators
    12. Finding numeric data with comparison operators
    13. Comparison operators for text
    14. Who am I?
    15. Who am I? Solution
    16. SQLcross
    17. Your SQL Toolbox
    18. SQLcross Solution
  5. 4. Better Where Clauses Filtering Rows
    1. Misplaced identification
    2. Multiple row requirements
    3. Combining your queries
    4. Use AND to satisfy two conditions
    5. To be OR not to be
    6. Code Magnets
    7. Code Magnets Solution
    8. Fireside Chats
    9. The difference between AND and OR
    10. BE the Conditional
    11. Be the Conditional Solution
    12. Use IS NULL to find NULLs
    13. IS NULL in your console
    14. Selecting ranges using AND and comparison operators
    15. Just BETWEEN us... there’s a better way
    16. Meanwhile, Abby dreams of sunshine...
    17. Save time with LIKE
    18. I’d LIKE to buy a wildcard, please
    19. You’re either IN...
    20. ... or you are NOT IN
    21. And that’s NOT all
    22. WHERE for the win
    23. SQLcross
    24. Your SQL toolbox
    25. SQLcross Solution
  6. About the Author

Product information

  • Title: Head First SQL
  • Author(s): Kimberly Fessel
  • Release date: August 2026
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781098163655