< Sql Tutorial

Sql Select

← Previous Next →


SQL SELECT statement is used to query or retrieve data from a table in the database.

SQL SELECT Syntax

SELECT column_name,column_name FROM table_name;

and

SELECT * FROM table_name;

database table student_details;

ID first_name last_name AGE SUBJECT GAMES
100 Rahul Sharma 10 Science Cricket
101 Anjali Bhagwat 12 Maths Football
102 Stephen Fleming 09 Science Cricket
103 Shekar Gowda 18 Maths Badminton
104 Priya Chandra 15 Economics Chess

NOTE:  These database tables are used here for better explanation of SQL commands. In reality, the tables can have different columns and different data. For example, consider the table student_details. To select the first name of all the students the query would be like:

SELECT first_name FROM student_details;
← Previous Next →