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

SQL · Theory

IS NOT NULL

← All stacks

Theory

57/439

IS NOT NULL

WHERE marks IS NOT NULL; rows that actually have a marks value (including 0). Use it when you want ‘exam written’ vs ‘absent’.

COUNT(marks) is similar to counting IS NOT NULL on that column.

Trap — IS NOT NULL and then still using the column in a way that assumes it cannot be 0.

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

Exam tip

WHERE marks IS NOT NULL;

IS NOT NULL — sample query

-- IS NOT NULL
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;

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

Short notes

  • DefIS NOT NULL = column has a value.
  • Rule0 is a value. NULL is not.
  • TrapTreating 0 as missing.

Questions

1

IS NOT NULL vs > 0?

57 / 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.