How do you select all columns of a table?
To select every column of a table, use the * symbol in a SELECT command.
Syntax:
sql
SELECT *
FROM Table_Name;Example:
sql
SELECT *
FROM Employees;What this query does
- Pulls every column (
ID,Name,Age,DepartmentID, etc.) from theEmployeestable. - Shows every record, unless a
WHEREis specified.
Notes:
- Convenient for quickly browsing an entire table.
- On large tables with many columns, using
*can be inefficient, it's better to select only the fields you need.
Put simply,
SELECT *is a way to pull all of a table's data at once.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.