SELECT name FROM celebs;
SELECT statements are used to fetch data from a database. Here,
SELECT returns all data in the
name column of the
SELECT is a clause that indicates that the statement is a query. You will use
SELECT every time you query data from a database.
name specifies the column to query data from.
FROM celebs specifies the name of the table to query data from. In this statement, data is queried from the
You can also query data from all columns in a table with
SELECT * FROM celebs;
* is a special wildcard character that we have been using. It allows you to select every column in a table without having to name each one individually. Here, the result set contains every column in the
SELECT statements always return a new table called the result set.