PGoCareerGoCareer prep tools
Home
LoginSign up
  • Java
  • Python
  • AI
  • React
  • Angular
  • PHP
  • Node.js
  • SQL
  • DSA
  • HTML
  • CSS
  • JS
  • Spring
  • ML
  • MongoDB

SQL · Theory

min()

← All stacks

Theory

121/439

min()

If you can teach min() using a min dry-run, you know it. If you only know the heading, you don’t.

For min(), the query planner is in play. Don’t blame it until you have traced a min dry-run.

min() exists so Ananya can keep a min dry-run correct in lab hour.

Use min() when a min dry-run must stay clear. If a simpler SQL step works, use that instead.

min() trap — skipping the failure case for min. Ananya loses marks for that every viva.

Place min() next to nearby SQL work — one min step Ananya can write from memory is the link.

Viva for min(): what it is → one min step Ananya can write from memory → the mistake (skipping the failure case for min).

Exam tip

For min(): definition + lab hour + one failure.

min() — sample query

CREATE TABLE scores (id INTEGER PRIMARY KEY, marks INTEGER);
INSERT INTO scores VALUES (1, 80), (2, 90), (3, 70);
SELECT COUNT(*) AS n, AVG(marks) AS avg_marks, MAX(marks) AS top
FROM scores;

min() — aggregate functions collapse many rows into one summary row.

Short notes

  • Defmin() — Ananya uses it for a min dry-run in lab hour.
  • Rulemin() → one min step Ananya can write from memory.
  • Remembermin() + the query planner (lab hour).
  • Usemin() in lab hour (a min dry-run).
  • Trapmin() — skipping the failure case for min.
  • Exmin() → a min dry-run.

Questions

1

What is min()? Teach it with a min dry-run.

2

If you skip min(), what breaks in lab hour?

3

How do you catch skipping the failure case for min?

4

Show min() in the query planner terms — three lines max.

Previous← avg()Nextmax() →
P

GoCareerGo

Utilities · Preparation Hub · Resume · CV · Tools — one workspace.

Workspace

DashboardProfilePreparation HubResume builderCV builderCareer planning

PDF Tools

Merge PDFSplit PDFCompress PDFImage to PDFAll toolsJobs

Image & QR

Compress ImageResize ImageQR ScannerQR GeneratorBlogIT interview prep

Company

FAQFeedbackContactPrivacyTermsSitemap

© 2026 GoCareerGo. Keep moving forward.