Javatpoint Logo
Javatpoint Logo

Data Query Language

Data Query Language:

DQL statements are employed to conduct inquiries on the information contained in schema objects. The main purpose of the DQL command is to provide a schema according to the query written. We can understand DQL as follows: It is also a SQL statement that is sued to get the data from the given database and apply order to it. The SELECT statement is used in the DQL command. With the SELECT command, we can get the data from the database and manipulate it as we want. When the SELECT statement is used on the tables, there is another table in the output, and it is called the front-end table. This table is presented or may even be used by the program.

Data Query Language (DQL) is one of the basic sub-languages of SQL statements. There are generally four categories in SQL languages which are data query language (DQL), data definition language (DDL), data control language (DCL), and data manipulation language(DML). It is also occasionally suggested that a transaction control language (TCL) belongs in the sub-language set.

DQL statements are employed to conduct inquiries on the information contained in schema objects. The required data is retrieved according to the query using Data Query Language (DQL) commands.

Although sometimes mistaken for a DML component, the SELECT statement is actually a DQL example. The SELECT statement becomes a component of the DML when FROM or WHERE data manipulators are added.

DQL Commands:

The SELECT command is used in Data Query Language Command.

SELECT Command:

The most utilized SQL statement is select. Data from a database can be retrieved or fetched using the SELECT Statement in SQL. Either the entire table or a subset of it can be retrieved. A result table contains the data that was returned. The result set also refers to this result table. In the SELECT command, either we can show all the columns, or we can get some specific columns in the result of the query according to the clause we use in the statement. The SELECT statement is analyzed by the database server, and it is determined which one is the first clause and which one is the last. This analysis is very much needed because we have to be very cautious about which column should be included in the result and which one should not be included.

Examples of SELECT Command:

Example1:

Creating the table:

Table structure:

Data Query Language

Select Command:

Output:

Data Query Language

Query 2:

Select those rows where the city is Jaipur.

Code:

Output:

Data Query Language

Query 3:

Selecting those tuples whose name starts with 'A'.

Code:

Output:

Data Query Language

Query 4:

Selecting those tuples First name whose id is less than 60 and greater than 20.

Code:

Output:

Data Query Language





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA