Basic SQL Skills for Product Managers

Thaisa Fernandes
Jun 3, 2019 · 7 min read
Image for post
Image for post
Photo by Liana Mikah on Unsplash
By Programming with Mosh

What’s SQL?

MySQL and PostgreSQL databases

How can I use it?

How do queries work?

Connecting to a database

SQL SELECT statement

SELECT column1, column2….columnNFROM table_name;
SELECT population FROM worldWHERE name = ‘Brazil’
SELECT name FROM worldWHERE name LIKE ‘B%’
SELECT name FROM worldWHERE population = 63206900
SELECT name FROM worldWHERE population >(SELECT population FROM worldWHERE name=’India’)
SELECT continent, name, population FROM world xWHERE population >= ALL(SELECT population FROM world yWHERE y.continent=x.continentAND population>0)

SQL WHERE clause

SELECT * FROM tableName WHERE condition;
SELECT * FROM CustomersWHERE Country=’Pakistan’;
SELECT * FROM CustomersWHERE Subscription=’Paid’
DELETEFROM mytableWHERE mycol IS NULL OR mycol = 100
SELECT ename WHERE ename IN (‘Paid’, ‘Free’)
SELECT ename WHERE ename BETWEEN ‘Free’ AND ‘Pro’

SQL Syntax

SQL SELECT Statement

SELECT column1, column2….columnZFROM table_name;

SQL DISTINCT Clause

SELECT DISTINCT column1, column2….columnZFROM table_name;

SQL WHERE Clause

SELECT column1, column2….columnZFROM table_nameWHERE CONDITION;

SQL AND/OR Clause

SELECT column1, column2….columnZFROM table_nameWHERE CONDITION-1 {AND|OR} CONDITION-2;

SQL IN Clause

SELECT column1, column2….columnZFROM table_nameWHERE column_name IN (val-1, val-2,…val-N);

SQL BETWEEN Clause

SELECT column1, column2….columnZFROM table_nameWHERE column_name BETWEEN val-1 AND val-2;

SQL LIKE Clause

SELECT column1, column2….columnZFROM table_nameWHERE column_name LIKE { PATTERN };

SQL ORDER BY Clause

SELECT column1, column2….columnZFROM table_nameWHERE CONDITIONORDER BY column_name {ASC|DESC};

SQL GROUP BY Clause

SELECT SUM(column_name)FROM table_nameWHERE CONDITIONGROUP BY column_name;

SQL COUNT Clause

SELECT COUNT(column_name)FROM table_nameWHERE CONDITION;

SQL HAVING Clause

SELECT SUM(column_name)FROM table_nameWHERE CONDITIONGROUP BY column_nameHAVING (arithmetic function condition);

Logical operators

AND

OR

NOT

In case you want to dig into this a little deeper, below you’ll find more resources.




👏🏾👏🏿Clap once. 👏🏼👏🏾 Clap twice. 👏👏🏻👏🏽 Clap however many times you want.

Find out more at the PM101 Website, Instagram and Twitter. If you’re looking for PM goodies, check out the Online store.

📩 Hey you, join the PM101 email list!

PM101

Product and Program Management content

Sign up for PM101 Newsletter

By PM101

Monthly updates regarding Product and Program Management; methodologies and frameworks; certifications and time management. Take a look

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

Check your inbox
Medium sent you an email at to complete your subscription.

Thaisa Fernandes

Written by

Problem solver and perfectionist in recovery willing to stretch myself and risk making mistakes to achieve innovative solutions and validate my learnings

PM101

PM101

Since 2016 sharing knowledge about the PM world with half million visitors yearly.

Thaisa Fernandes

Written by

Problem solver and perfectionist in recovery willing to stretch myself and risk making mistakes to achieve innovative solutions and validate my learnings

PM101

PM101

Since 2016 sharing knowledge about the PM world with half million visitors yearly.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store