Olawale Ahmed Alamu
1 min readNov 4, 2022

--

SQL Daily Practice — Day 1

SQL is an essential tool for every Data Analyst, Data Scientists and BI Analyst

SQL is the language for querying relational databases.

Structured Query Language comes in different flavours like MySQL, SQLite and PosgreSQL.

One of the resources to hone SQL skills is sql-practice-dot-com.

Let's jump straight into today's question.

QUESTION: Show the first name, last name, and gender of patients whose gender is 'M'.

PROBLEM ANALYSIS: We are to output the first name and last name of male patients.

The patients' table has the following columns:

patient_id INT
first_name TEXT
last_name TEXT
gender CHAR(1)
birth_date DATE
city TEXT
province_id CHAR(2)
allergies TEXT
height INT
weight INT

SOLUTION: We write a SELECT statement to generate first name and last name couple with a WHERE clause to restrict the selection to only male patients ('M')

SQL SCRIPT:
-- -- -- -- -- --
SELECT first_name, last_name
FROM patients
WHERE gender = 'M'
 — — — — — —

Follow Olawale Ahmed Alamu and the #SQLDailyPractice for daily updates.

--

--

Olawale Ahmed Alamu

CS Grad | Power BI | Microsoft Excel | Learning and Teaching SQL Daily