top of page

“Maybe It’s You.” Choosing Your One True SQL: PostgreSQL🐘 vs MySQL 🐬

Updated: 2 days ago

“I’m not a ‘maybe.’ I’m the one.” — Joe Goldberg, YOU


Don’t worry, you don’t need serial-killer focus to master databases. You just need the right first step. This guide strips SQL down to the basics and shows how the two most popular databases PostgreSQL and MySQL handle the same beginner tasks.


 What is SQL, really?


SQL (Structured Query Language) is a standard set of commands that let you store, find, and update data in tables (think spreadsheets with superpowers).




Setting Up (The 5-Minute Version)


Step

PostgreSQL 🐘

MySQL 🐬

Install

sudo apt install postgresql

sudo apt install mysql-server

Open a prompt

psql -U postgres

mysql -u root -p

Create a test DB

CREATE DATABASE library;

CREATE DATABASE library;

First Table & First Rows



-- Run this in EITHER database

CREATE TABLE books (

id SERIAL PRIMARY KEY, -- Postgres keyword

-- MySQL users: replace with INT AUTO_INCREMENT

title VARCHAR(100),

author VARCHAR(100),

year_pub INT

);


INSERT INTO books (title, author, year_pub) VALUES

('1984', 'George Orwell', 1949),

('The Pragmatic Programmer', 'Hunt & Thomas', 1999);


Key difference to remember:

  • PostgreSQL uses SERIAL (or GENERATED AS IDENTITY) to auto-number rows.

  • MySQL uses AUTO_INCREMENT.


Reading Data (Your Bread-and-Butter Commands)


Goal

SQL Command

What It Does

Show every row

SELECT * FROM books;

Lists the full table.

Show only titles

SELECT title FROM books;

One column.

Filter rows

SELECT * FROM books WHERE year_pub < 2000;

Adds a simple condition.

Sort results

SELECT * FROM books ORDER BY year_pub DESC;

Newest first.

Limit results

SELECT * FROM books LIMIT 2;

Shows two rows—works the same in both DBs.

That’s 95 % of what you’ll do as a beginner.


Spot-the-Difference Cheat Sheet


Feature

PostgreSQL

MySQL

Auto-IDs

SERIAL / IDENTITY

AUTO_INCREMENT

Text vs Quotes

"double_quotes" around mixed-case identifiers

`backticks` (or leave names lowercase)

Case sensitivity

Sensitive if you use quotes

Usually case-insensitive on Windows/Mac

Default charset

UTF-8 out of the box

UTF-8 in recent versions (set with utf8mb4)

Backups

pg_dump

mysqldump


Truth bomb: for beginner projects these differences won’t block you.


Which One Should You Choose?


Pick PostgreSQL 🐘 if…

Pick MySQL 🐬 if…

You want “advanced later” (geo, JSON indexing).

You’re following a LAMP / WordPress tutorial.

You like stricter rules (it yells when you break them).

You just need something light and everywhere.

You enjoy its big open-source extension scene.

Your cheap hosting provider already gives you MySQL.



Wrapping Up (No Stalking Required)


SQL isn’t scary. With five basic commands (CREATE, INSERT, SELECT, UPDATE, DELETE) you can already build a project portfolio, whether you’re storing recipes or tracking expenses.


So “Maybe it’s you.” Time to choose your first SQL partner and start coding. Questions? Ping me on LinkedIn. I’m here to help… just a lot less creepy than Joe.

And with that, we reach the end of the blog. I hope you had a good read and learned a lot. Stay tuned as we'll cover more tech-related topics in future blogs.


In case of any questions or suggestions, feel free to reach out to me via LinkedIn. I'm always open to fruitful discussions.🍏🦜


Comments


Thanks for submitting!

  • Instagram
  • LinkedIn
  • Youtube
  • Facebook

Contact

young4STEM

young4STEM, o.z.

Support us!

young4STEM is an international non-profit that needs your help.
We are trying our best to contribute to the STEM community and aid students from all around the world.
Running such an extensive platform - as students - can be a financial challenge.
Help young4STEM continue to grow and create opportunities in STEM worldwide!
We appreciate every donation. Thank you :)

One time

Amount:

0/100

Comment (optional)

bottom of page