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

SQL · Theory

Aggregate Functions

← All stacks

Theory

117/439

Aggregate Functions

Aggregate Functions is simple if you keep it on paper. Priya uses it for average per subject in a report.

Aggregate Functions on the board — GROUP BY subject. Then say what average per subject looks like after.

Aggregate Functions exists so Priya can keep average per subject correct in a report.

Use Aggregate Functions when average per subject must stay clear. If a simpler SQL step works, use that instead.

Aggregate Functions trap — SELECT extra column not in GROUP BY. Priya loses marks for that every viva.

Place Aggregate Functions next to nearby SQL work — GROUP BY subject is the link.

Close Aggregate Functions with: “If I skip it, average per subject goes wrong like this: SELECT extra column not in GROUP BY.”

Exam tip

Say Aggregate Functions in one breath, then GROUP BY subject, then SELECT extra column not in GROUP BY.

Aggregate Functions — 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;

Aggregate functions collapse many rows into one summary row.

Short notes

  • DefAggregate Functions — Priya uses it for average per subject in a report.
  • RuleAggregate Functions → GROUP BY subject.
  • RememberAggregate Functions + the query planner (a report).
  • UseAggregate Functions in a report (average per subject).
  • TrapAggregate Functions — SELECT extra column not in GROUP BY.
  • ExAggregate Functions → average per subject.

Questions

1

Priya asks: why does Aggregate Functions exist? Use average per subject.

2

If you skip Aggregate Functions, what breaks in a report?

3

How do you catch SELECT extra column not in GROUP BY?

4

Write the smallest Aggregate Functions step on average per subject. What happens?

Previous← PL/SQL InterviewNextcount() →
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.