Columns & Aliases
Selecting specific columns, aliasing, schema-qualified names.
What you’ll learn
- Pick specific columns and alias them.
- Qualify with schema and use short table aliases.
SELECT c.CustomerID AS Id, c.Name, c.Country
FROM dbo.Customers AS c;
-- Column alias without AS is allowed, but AS improves clarity
SELECT OrderID AS Id, OrderDate AS PlacedOn FROM dbo.Orders;
Notes
- Prefer explicit column lists over
SELECT *
for stability and perf. - Use schema-qualified names (e.g.,
dbo.Table
) to avoid ambiguity.