Retrieving the Single Column Data

we can retrieve the single column’s data that want to fetch and it can be achieved by placing the column name in the place of ” * ” followed by from keyword and the table name.

Syntax:

SELECT  COLUMN NAME FROM TABLE NAME;

Example:

let us retrieve the data from the column i.e “first_name” from the students table to achieve that just place the first_name in the place of COLUMN NAME and students in the TABLE NAME that you find in the syntax.

SELECT first_name FROM students;

There in the output you can see the first_name column is fetched and it contains four records.

Output:

SQLite SELECT Query

SQLite is a serverless, popular, easy-to-use, relational database system that is written in c programming language. SQLite is a database engine that is built into all the popular devices that we use every day of our lives including TV, Mobile, and Computer.

As we know that we create the tables in the database and insert the data into them to store the data but, what is the use of storing the data without fetching the data? So let us learn how to retrieve the data from the database. Here comes the SELECT QUERY which is used to fetch the data from the database and in this article we are going to discuss SQLite SELECT Query. After reading this article we will gain knowledge about the Select Query.

Similar Reads

SQLite SELECT Query

SELECT QUERY is used to retrieve the data from the database. The select query does not make any changes to the database it just fetches the data that we are asking for. Select query plays a major role in SQLite because you can not retrieve the data without it....

Example: Fetch the Data by Using SELECT Query

We will create the table, insert the data and fetch the data. We will use SQLite select statement to fetch the data and the data is fetched in four ways as shown below:...

1. Retrieving All the data

we can retrieve all the data using the “SELECT * ” . Syntax is select that is followed by asterisk ( * ), space, From keyword and the Table Name from which you are going to fetch the data....

2. Retrieving the Single Column Data

we can retrieve the single column’s data that want to fetch and it can be achieved by placing the column name in the place of ” * ” followed by from keyword and the table name....

3. Retrieving the Multiple Columns Data

we can also fetch the data from multiple columns at a time by using the below syntax. In the syntax you can observe that there are multiple columns from 1 to N, from keyword followed by the TABLE NAME that you are going to fetch the data from....

4. Selecting Columns as Alias

we can also select the columns using the alias names i.e by using nick names. For example, we the humans have our original names and also the nick name in the same way we can use the alias names for our columns. In the syntax you can see that select keyword followed by column_name is the original name of the field, as keyword followed by the alias_name i.e the name by which you want to display the field, from followed by the table name from which the data is to be fetched....

Conclusion

This is how we fetch the data from the students table using the SELECT QUERY in SQLite in different ways, from the different columns, tables and this query plays the most important role because storing the data is not important if you can not fetch it. So, it is such important to know about SQLITE SELECT QUERY and this how it is used....