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

SQL · Theory

Math

← All stacks

Theory

176/439

Math

Math functions — ABS, ROUND, FLOOR, CEIL, MOD, POW. SELECT ROUND(AVG(marks), 1) FROM students;

Use DECIMAL for money, then ROUND for display. RAND() is random — not for cryptography.

Trap — TRUNCATE(x,d) vs TRUNCATE TABLE. Different commands.

On the example next to this theory: Math: create two demo rows, then SELECT qty >= 2 ordered. Say which labels come back.

Exam tip

ROUND / ABS / MOD with one numeric SELECT.

Math — sample query

-- Math
CREATE TABLE demo (
  id INTEGER PRIMARY KEY,
  label TEXT NOT NULL,
  qty INTEGER DEFAULT 0
);
INSERT INTO demo (id, label, qty) VALUES
  (1, 'alpha', 2),
  (2, 'beta', 5);
SELECT label, qty FROM demo WHERE qty >= 2 ORDER BY qty DESC;

Math: create two demo rows, then SELECT qty >= 2 ordered. Say which labels come back.

Short notes

  • DefMath functions take numbers, return numbers.
  • RuleROUND for display. DECIMAL for money.
  • TrapTRUNCATE function vs TRUNCATE TABLE.

Questions

1

Round average marks to 1 decimal?

176 / 439

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.