Coder Social home page Coder Social logo

mswarankit / practical-sql-2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anthonydb/practical-sql-2

0.0 0.0 0.0 278.8 MB

Code and Data for the Second Edition of "Practical SQL" by Anthony DeBarros, published by No Starch Press (2022).

License: Other

PLpgSQL 100.00%

practical-sql-2's Introduction

Practical SQL, 2nd Edition

A Beginner's Guide to Storytelling with Data

Practical SQL, 2nd Edition is a beginner-friendly guide to the database programming language SQL. Author Anthony DeBarros starts with beginner SQL concepts such as queries, data types, and basic math and aggregation, and then works through intermediate and advanced topics including statistics, cleaning data, GIS, and automating tasks. Along the way, you'll use real-world data from the U.S. Census and other government agencies and learn the fundamentals of good database design. This is a book not only about SQL but about best practices for using it for thorough, accurate data analysis.

A Note About Editions

If you're reading the first edition of the book, published in 2018, please use the code and data in the first edition repository. If the cover of your copy does not say, "2nd Edition," then you're using the first edition.

Who Is This Book For?

Practical SQL is ideal for beginners as well as those who know some SQL and want to go deeper.

Which Database Does The Book Use?

We use PostgreSQL, which is free and open source. PostgreSQL is used by some of the world's largest companies. Its SQL syntax adheres closely to the ANSI SQL standard, and the concepts you learn will apply to most database management systems, including MySQL, Oracle, SQLite, and others. Note that Microsoft SQL Server employs a variant of SQL called T-SQL, which is not covered by Practical SQL.

What's In This Repository?

Code: All the SQL statements and command-line listings used in each chapter, organized by chapter folders.

Data: CSV and JSON files plus GIS shapefiles for you to import, also organized by chapter. NOTE! See the warning below about opening CSV files with Excel or text editors in the section on Getting the Code and Data.

Exercises: The "Try It Yourself" questions and answers for each chapter, listed separately. Try working through the questions before peeking at the answers.

Software Installation Updates: Over time, the instructions for installing PostgreSQL and additional components may change. You'll find updates noted at software-installation-updates.md.

FAQ, Updates, and Errata: Answers to frequently asked questions, updates, and corrections are noted at faq-updates-errata.md.

Resources: Updates to the book's Appendix on Additional PostgreSQL Resources at resources.md.

What's Covered in Each Chapter?

  • 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
  • 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
  • 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

How Do I Get the Code and Data?

Non-GitHub Users

You can obtain all the code and data at once by downloading this repository as a .zip file. To do that:

  • Click the Code button at top right.
  • Click Download ZIP
  • Unzip the file on your computer. Place it in a directory that's easy to remember so you can reference it during the exercises that include importing data to PostgreSQL.
  • For additional instructions, please read Chapter 1 in the book.

Warning about CSV files!: Opening CSV files with Excel could lead to data loss. Excel will remove leading zeros from numbers that are intended to be stored as text, such as ZIP codes. To view the contents of a CSV file, only do so with a plain-text editor and be careful not to save the file in an encoding other than UTF-8.

GitHub Users

GitHub users may want to clone the repository locally and occasionally perform a git pull to receive updates.

Where Can I Buy the Book?

Practical SQL, 2nd Edition is available in PDF, .mobi, .epub, and classic print formats.

How Can I Get Help?

Questions? Please open an issue in this repository by navigating to Issues and clicking New Issue. Fill out the form, and I will answer usually within 1 to 2 business days. For other types of inquiries, please email [email protected].

practical-sql-2's People

Contributors

anthonydb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.