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

SQL · Theory

LEFT()()

← All stacks

Theory

145/439

LEFT()()

LEFT() first n characters. You use it in SELECT (and sometimes WHERE/UPDATE). It does not change stored data unless you UPDATE … SET col = LEFT(col).

Board: SELECT LEFT(name, 1) FROM students; Run it. Say the result out loud. If the column is NULL, the result is often NULL — wrap with IFNULL if you need a blank instead.

String indexes in MySQL start at 1, not 0 (SUBSTR, INSTR, LEFT). Not the left table of a JOIN.

Interview — name LEFT, one argument list, one example on the students table. Don’t recite every string function.

On the example next to this theory — LEFT()() — jOIN combines rows using a match condition between tables.

Exam tip

Say what LEFT returns, then SELECT LEFT(name, 1) FROM students;

LEFT()() — 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;

LEFT()() — jOIN combines rows using a match condition between tables.

Short notes

  • DefLEFT() first n characters.
  • RuleSELECT LEFT(name, 1) FROM students;
  • TrapNot the left table of a JOIN.

Questions

1

What does LEFT do?

2

Does it UPDATE the table?

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