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

SQL · Theory

Not Equal

← All stacks

Theory

55/439

Not Equal

Not equal is <> or != . WHERE marks <> 0; MySQL accepts both. Standard SQL prefers <>. NULL <> 0 is not true — use IS NOT NULL as well if you need rows with a value that is not 0.

Trap — marks != NULL. Use IS NOT NULL.

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

Exam tip

WHERE marks <> 40; never != NULL.

Not Equal — sample query

-- Not Equal
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;

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

Short notes

  • Def<> or != means not equal.
  • RulePrefer <>. Combine with IS NOT NULL when needed.
  • Trap!= NULL.

Questions

1

Not equal operator?

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