codescracker


sql

SQL Select



« Previous Tutorial Next Tutorial »


SQL SELECT statement is used to select the data from the database in the form of table. Here is the general form to use SELECT statement in SQL to fetch the required values along with fields of a table:

SELECT column_name,column_name
FROM table_name;

SQL Fetch All Fields of Table

Here is the general form of SELECT statement to fetch all the fields available in the table:

SELECT * FROM table_name;

SQL SELECT Column Example

Consider the table CUSTOMERS having the following records:

=
SQL Select

Following is an example, which would fetch the following columns:

Here is the SQL query used to fetch the above columns from the table CUSTOMERS:

SELECT ID, NAME, SALARY FROM CUSTOMERS;

After querying the above SQL statements, you will get the following output:

SQL Select statement

SQL SELECT * (all) Example

The following SQL statement selects all the columns available in the table "Customers"

select * from customers;

After querying the above SQL statements, you will get the following output:

SQL Select all

« Previous Tutorial Next Tutorial »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test