Title - SELECT SQL statements Tags - sqlstatements
SELECT statements are used to fetch data from a database.
They always return a new table called the ‘result set’.
Example 1:
SELECT name FROM celebs;
SELECT is the clause indicating that the statement is a query.
name specifies the column to query data from.
FROM celebs specifies the name of the table to query data from - in this case, the table named ‘celebs’.
Example 2:
SELECT * FROM celebs.
This statement queries data from all columns. The ’*’ is a wildcard character that allows you to select every column in a table without having to name each of them individually.