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

SQL · Theory

Inner Join

← All stacks

Theory

60/439

Inner Join

INNER JOIN is the default JOIN. Only rows with a match on both sides. A student with no marks row disappears from the result. A marks row with a bad roll (no student) also disappears.

SELECT s.name, m.score FROM students s INNER JOIN marks m ON s.roll = m.roll; Same as JOIN without the word INNER.

Use INNER when you only want complete pairs. Use LEFT when you still need students with no marks.

Trap — INNER JOIN then wondering why 2 of 30 students vanished — they had no child rows.

On the example next to this theory — Inner Join — jOIN combines rows using a match condition between tables.

Diagram
  students.id
       =
  marks.student_id
        │
        ▼
     one result row
Exam tip

INNER JOIN = only matches. LEFT JOIN if you need unmatched left rows.

Inner Join — sample query

CREATE TABLE customers (id INTEGER PRIMARY KEY, name TEXT);
CREATE TABLE orders (id INTEGER PRIMARY KEY, customer_id INTEGER, total INTEGER);
INSERT INTO customers VALUES (1, 'Asha'), (2, 'Ravi');
INSERT INTO orders VALUES (10, 1, 500), (11, 1, 200);
SELECT c.name, o.total
FROM customers c
JOIN orders o ON o.customer_id = c.id;

Inner Join — jOIN combines rows using a match condition between tables.

Short notes

  • DefINNER JOIN = matching rows only.
  • RuleSame as JOIN. Unmatched rows drop out.
  • TrapMissing students who have no marks yet.

Questions

1

INNER vs LEFT?

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