🔙 All posts

Getting around in SQL


Sql

Planted February 10, 2020

On Thursday evening, I’ll be taking part in another egghead.io workshop. This time the workshop will be delivered by Tyler Clark and will be on Advanced SQL (there is still time to sign up here).

In preparation, I watched Tyler’s first course on SQL that is hosted on egghead. It was really interesting and, though I knew most of it, I appreciated the clarity and focused nature of Tyler’s delivery.

Almost all of my experience with SQL has been with MySQL. Tyler delivers his course using PostgreSQL which is almost entirely new to me. I realised that while a lot of the syntax is the same between the two implementations, there are some basic differences when it comes to navigation between databases and tables.

I put together a quick screencast to show these and I thought I’d share the screencast and a summary table.

youtube:https://www.youtube.com/watch?v=dD_omqx1H_I

IntentionMySQLPostgreSQL
List databasesSHOW DATABASES;\l
Connect to databaseUSE <db_name>\c <db_name>
List tables in databaseSHOW TABLES\dt
List rows in tableSELECT * FROM <table_name>SELECT * FROM <table_name>

Like what you see?

I send out a (semi) regular newsletter which shares the latest from here and my reading from around the web. Sign up below.

    Your next read?