SQL Quest › SQL Interview Questions › Joins
Sensor Readings of Failed Units
JOIN operational_data with failure_events to show all sensor readings of units that experienced any machine_failure. Show udi, air_temp_k, process_temp_k, rotational_speed_rpm, torque_nm. Order by torque_nm descending. Top 20.
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
operational_data
| udi | air_temp_k | process_temp_k | rotational_speed_rpm | torque_nm |
|---|---|---|---|---|
| 5640 | 302.6 | 312.1 | 1668 | 28.7 |
| 2171 | 299.4 | 309.1 | 1500 | 43.3 |
| 228 | 298.3 | 308.5 | 1539 | 36.1 |
failure_events
| udi | machine_failure | twf | hdf | pwf | osf | rnf |
|---|---|---|---|---|---|---|
| 5640 | 0 | 0 | 0 | 0 | 0 | 1 |
| 2171 | 0 | 0 | 0 | 0 | 0 | 0 |
| 228 | 0 | 0 | 0 | 0 | 0 | 0 |
Expected output: Operational profile of failures
Hint
Concepts
SELECT JOIN WHERE
Practise the topic: SQL practice questions · JOIN practice
In these company practice sets
A SQL Quest challenge matched to patterns reported for these companies — not a question any of them has published.
Related questions
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