In Apex, you almost never hard-code row IDs in production code. You describe what you want with SOQL: which object, which fields, optional filters, sort, and a cap on rows. Start with SELECT and FROM, then add WHERE only when you need to narrow the set — it saves limits and keeps logic obvious.
Fields (SELECT …)
Toggle fields. In real Apex you only query what you need — fewer fields means faster queries and less heap.
Filter (WHERE)
WHERE is optional. Use it to match business rules (region, stage, owner, …).
ORDER BY
LIMIT
LIMIT caps rows — essential for loops and governor-limit safety.
SELECT Id, Name FROM Account LIMIT 50
Run it in Apex: wrap in square brackets to get a List<Account>.
List<Account> rows = [ SELECT Id, Name FROM Account LIMIT 50 ];
Fetch with SOQL once, store in a List or Map, then iterate. Putting a query inside a tight loop is the pattern that burns governor limits — students learn to spot that early.
List<Account> accounts = [SELECT Id, Name FROM Account LIMIT 100];
for (Account a : accounts) {
// work with a.Name in memory — no SOQL here
}