SQL QuestSQL Interview Questions › Querying Basics

Filter with WHERE

EasyFreeQuerying Basics

Find all passengers who survived the Titanic (survived = 1). Show their name, sex, age, and pclass. Limit to 20 rows.

Solve it in the browser editor →

Runs on SQLite in your browser, graded against the expected result, no signup. A wrong answer gets a diagnosis, not just "incorrect".

Schema

passengers

passenger_idsurvivedpclassnamesexagesibspparchfareembarked
103Braund, Mr. Owen Harrismale22107.25S
211Cumings, Mrs. John Bradleyfemale381071.28C
313Heikkinen, Miss. Lainafemale26007.93S

Expected output: Only survivors, showing name, sex, age, pclass

Hint

WHERE survived = 1 filters to only survivors. The survived column uses 1 for yes, 0 for no.

Concepts

SELECT WHERE

Practise the topic: SQL practice questions

Related questions

Your First QueryEasy · FreePick Your ColumnsEasy · FreeComparison OperatorsEasy · FreeMultiple Conditions (AND / OR)Easy · FreeThe IN OperatorEasy · FreeSorting and LimitingEasy · Free

Where would this cost you points in an interview?

Ten questions, no signup: a Skillmap across nine SQL skills and the one to fix first.

Take the readiness test