Skip to main content
PreparationZone Logo
PreparationZone
Back to Fundamentals

Fundamentals · Easy · Free

Write SELECT with WHERE, ORDER BY, LIMIT — interview habits.

FresherFundamentalsDatabase Fundamentals
Model answer

SELECT habits

sql
SELECT id, name, score
FROM students
WHERE dept = 'CSE' AND score >= 75
ORDER BY score DESC
LIMIT 10;
  • Select only needed columns
  • Filter early with WHERE
  • LIMIT in dev to avoid accidents
Mention parameterized queries—never string-concat user input.