#1 Data Analytics Program in India
₹2,499₹1,499Enroll Now
Step 5
3 min read

FROM Clause

Learn how to specify which table to retrieve data from in your SQL queries.

What is FROM?

FROM tells SQL which table to get data from. Like telling a librarian "get me books FROM the fiction section."

How FROM Works

Step-by-step:

  1. SELECT name, age - What columns you want
  2. FROM students - Which table to look in
  3. Get data - Database finds the table and columns
  4. Return - Results come back to you

Basic Syntax

SELECT columns FROM table_name;

Examples

-- Get all columns from students SELECT * FROM students; -- Get specific columns SELECT name, age FROM students; -- With WHERE filter SELECT name FROM students WHERE age > 20;

Query Order

SELECT columns -- 1. What to show FROM table_name -- 2. Where to get it WHERE condition -- 3. Filter results ORDER BY column; -- 4. Sort results

Table Aliases (Shortcuts)

Give tables shorter names:

-- Long way SELECT students.name FROM students; -- Short way with alias SELECT s.name FROM students s;

Try FROM Below

Use the playground to practice FROM queries.

What Comes Next

Next: Learn WHERE clause to filter your results.

Try SELECT...FROM

Query data from the table. Try: SELECT name, age FROM students;

Source Table: students
idnameagegrade
1Alice20A
2Bob22B
3Charlie21A
4David23B
4 rows
SQL Editor
Loading...

Finished this topic?

Mark it complete to track your progress and maintain your streak!

SkillsetMaster - AI, Web Development & Data Analytics Courses