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

SQL · Theory

Update Join

← All stacks

Theory

66/439

Update Join

UPDATE students s JOIN marks m ON s.roll = m.roll SET s.marks = m.score WHERE m.subject = 'Maths'; copy a value across tables. JOIN picks the rows, SET changes them.

Preview with SELECT s.roll, s.marks, m.score FROM … the same JOIN. Then UPDATE.

Trap: UPDATE without JOIN when the new value lives in another table. Trap: multiple marks rows per student — which one wins is messy; be specific in WHERE.

On the example next to this theory — Update Join — uPDATE changes existing rows — always scope with WHERE.

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

UPDATE s JOIN m ON s.roll = m.roll SET s.marks = m.score;

Update Join — sample query

CREATE TABLE products (id INTEGER PRIMARY KEY, name TEXT, price REAL);
INSERT INTO products VALUES (1, 'Mouse', 499);
UPDATE products SET price = 449 WHERE id = 1;
SELECT * FROM products;

Update Join — uPDATE changes existing rows — always scope with WHERE.

Short notes

  • DefUPDATE … JOIN … SET … updates using another table.
  • RuleSame JOIN as the preview SELECT.
  • TrapOne student matching many marks rows.

Questions

1

How do you update from another table?

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