# What is SOQL and how does it differ from standard SQL (e.g., no SELECT *, no arbitrary table joins)?

**Topic:** Soql · **Difficulty:** Easy · **Asked at:** TCS, Infosys, Wipro · **Tags:** soql, fundamentals

Read it on the site: https://www.forcechallenges.com/interview-questions/what-is-soql-and-how-does-it-differ-from-standard-sql-e-g-no-select-no-arbitrary-table-joins

## Answer

**SOQL** (Salesforce Object Query Language) queries records from Salesforce objects, similar to SQL SELECT but object-oriented.

Differences from SQL:
- No `SELECT *` (use explicit fields or `FIELDS()`)
- No arbitrary joins; only relationship queries (child-to-parent dot notation, parent-to-child subqueries) along defined relationships
- Read-only: no INSERT/UPDATE/DELETE statements (DML is separate)
- Limited functions, no `UNION`, no `DISTINCT`-style joins; no arbitrary aliases for tables in the same way
- Subject to governor limits and security (sharing, FLS)

```soql
SELECT Id, Name, Account.Name FROM Contact WHERE LastName LIKE 'S%'
```

---
Source: ForceChallenges · last updated 2026-10-21
