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

SQL · Theory

FROM

← All stacks

Theory

42/439

FROM

FROM students names the table (or view). SELECT cannot guess the table. Joins also live here: FROM students s JOIN marks m ON s.roll = m.roll.

Alias — FROM students AS s — s.name is shorter. Needed when two tables share column names.

Trap — FROM missing. Trap: FROM students, marks without ON — old comma join = CROSS JOIN.

On the example next to this theory — FROM — sELECT projects columns; WHERE filters; ORDER BY sorts.

Diagram
  FROM students
        │
        ▼
  WHERE city = 'Pune'
        │
        ▼
  SELECT name, marks
Exam tip

FROM students. Joins belong in FROM … ON …

FROM — sample query

CREATE TABLE employees (id INTEGER PRIMARY KEY, name TEXT, dept TEXT, salary INTEGER);
INSERT INTO employees VALUES
  (1, 'Asha', 'Eng', 70000),
  (2, 'Ravi', 'Eng', 65000),
  (3, 'Neha', 'HR', 50000);
SELECT name, salary FROM employees WHERE dept = 'Eng' ORDER BY salary DESC;

FROM — sELECT projects columns; WHERE filters; ORDER BY sorts.

Short notes

  • DefFROM picks the table or join.
  • RuleAlias tables in joins (s, m).
  • TrapComma join without ON.

Questions

1

What does FROM do?

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