- MySQL Select
Fetching Data
The SELECT
statement is used to fetch data from a database.
It indicates that the statement is a query.
The SELECT
is used every time we have to retrieve a set of records.
Basic Format:
SELECT column_name FROM table_name
Example - 1:
SELECT name FROM jamfinity;
Example - 2:
SELECT * FROM customer;
Let’s break down our query statement:
SELECT
indicates that the statement is a query.name
specifies the Column from which you want to fetch the data.FROM jamfinity
specifies that the table we want to fetch the data from is called jamfinity.
To query data from all columns in a table we use
*
*
allows us to fetch every column in the table.