Javatpoint Logo
Javatpoint Logo

Select Data

SELECT statement is used to retrieve records from single or multiple tables.

Syntax:

The SELECT statement can be used with UNION statement, ORDER BY clause, LIMIT clause, WHERE clause, GROUP BY clause, HAVING clause etc.


Select All Columns from a Table

Example:

We have a table "Students", having some data. So retrieve all records from "Students".

Output:

Mariadb Select data 1

Select Individual Columns from a Table

You can retrieve individual columns from a table by using SELECT statement. It facilitates you to retrieve only those columns which you need.

Example:

Output:

Mariadb Select data 2

Here we select student_id, student_name, student_address from the table "Students" where student_id is less than 5 and we order the records in ascending order on the basis of student_id.






Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA