Create Databases and Tables#

In this section we’ll go over creating databases and tables. We’ll also cover the types of data that we can store in these tables:

  • Boolean

So far, we’ve been using INNER JOIN, which it’s the most common used one, but there are more. We’ll be using the old Jeff Atwood’s post about SQL joins (a classic), as a base for our explanation.

Create a Test database#

Let’s create a database named test so we can add a couple of tables to explain a few more SQL joins. Open the terminal and run:

createdb -h localhost -p 5432 -U bob test_joins

Now let’s create a connection to this new database:

Create Tables#

Now let’s add a couple of tables to test_joins. The first: