Our preferred relational database of choice which deserves more love. Learn the advantages that PostgreSQL provides over closed-source competitors.
Welcome to SQL 4: Aggregate Functions

Welcome to SQL 4: Aggregate Functions

Become more intimate with your data- use SQL's aggregate functions to explore the traits which make your data unique and beautiful.

Aggregate functions in SQL are super dope. When combining these functions with clauses such as GROUP BY and HAVING, we discover ways to view our data from completely new perspectives. Instead of looking at the same old endless flat table, we can use these functions to give us entirely new insights; aggregate functions help us to understand bigger-picture things. Those things might include finding outliers in datasets, or simply figuring out which employee with a family to feed should be terminated, based on some arbitrary metric such as sales numbers.

With the basics of JOINs under our belts, this

Welcome to SQL 3: Building Relations and Combining Data Sets

Welcome to SQL 3: Building Relations and Combining Data Sets

This week we look at the fun side of SQL where we JOIN tables and create UNIONs.

If you've felt a bit distance or estranged from SQL so far in the series, never fear: we're about to discover the magic of what makes relational databases so... relational. Turn down the lights and put on your favorite Marvin Gaye track; we're about to make connections on a whole other level.

I find that existing attempts to explain Database relations (JOINs in particular) have been an utter failure in illustrating these concepts. The Venn Diagrams we're all accustomed to seeing mean nothing to somebody who has never seen a JOIN occur, and even then, do they really describe what's

Welcome to SQL 2: Selecting, Updating, and Deleting Data

Welcome to SQL 2: Selecting, Updating, and Deleting Data

Explore the many flavors of SQL data manipulation in part 2 of our series.

Now that we've gotten the fundamentals of creating databases and tables out of the way, we can start getting into the meat and potatoes of SQL interactions: selecting, updating, and deleting data.

We'll start with the basic structure of these queries and then break into the powerful operations with enough detail to make you dangerous.

Selecting Data From a Table

As mentioned previously, SQL operations have a rather strict order of operations which clauses have to respect in order to make a valid query. We'll begin by dissecting a common SELECT statement:

Welcome to SQL: Modifying Databases and Tables

Welcome to SQL: Modifying Databases and Tables

Brush up on SQL fundamentals such as creating tables, schemas, and views.

SQL: we all pretend to be experts at it, and mostly get away with it thanks to StackOverflow. Paired with our vast experience of learning how to code in the 90s, our field work of PHPMyAdmin and LAMP stacks basically makes us experts. Go ahead and chalk up a win for your resume.

SQL has been around longer than our careers have, so why start a series on it now? Surely there’s sufficient enough documentation that we can Google the specifics whenever the time comes for us to write a query? That, my friends, is precisely the problem. Regardless

Psycopg2: PostgreSQL & Python the Old Fashioned Way

Psycopg2: PostgreSQL & Python the Old Fashioned Way

Manage PostgreSQL database interactions in Python with the Psycopg2 library.

Last time we met, we joyfully shared a little tirade about missing out on functionality provided to us by libraries such as SQLAlchemy, and the advantages of interacting with databases where ORMs are involved. I stand by that sentiment, but I’ll now directly contradict myself by sharing some tips on using vanilla Psycopg2 to interact with databases.

We never know when we’ll be stranded on a desert island without access to SQLAlchemy, but a lonesome Psycopg2 washes up onshore. Either that or perhaps you’re part of a development team stuck in a certain way of doing things

Cloud SQL: Relational Databases on Google Cloud

Cloud SQL: Relational Databases on Google Cloud

Create a database in Google Cloud using Cloud SQL, compare Cloud SQL to RDS, and learn the admin API.

I've found that the strength of Google Cloud's services comes from consistently delivering across a few key metrics, namely reliability and performance. When dealing with SQL databases, it's hard to imagine any metrics more important than these two things, and Google's Cloud SQL delivers.

To become familiar with Cloud SQL, we're going to walk through the creation of a SQL database and explore the advantages Google Cloud offers us when compared to other solutions. We'll also be dipping into the Cloud SQL API to see how we might manage our SQL database programmatically.

Cloud SQL Versus Alternatives

There aren't many