All articles: Data Query Language (DQL)

Checkout our self-help content, created by our top Experts!
How to generate random numbers in SQL Server – Querychat
In this article, we will learn how to generate random numbers in SQL Server. For this, we will use the Rand function. Rand function in SQL Server SQL Server has the native Rand function, with which we can generate random floating numbers between 0 and 1. Later we will see...
How to generate random numbers in MySQL – Querychat
In this article, we will learn how to generate random integers and floating numbers in MySQL through practical examples. MySQL Rand function MySQL has a native function that allows random number generation. We are talking about the Rand function. Something we have to keep in mind is that the Rand...
How to use SQL Except clause in SQL Server – Querychat
In this article, we will learn how to use the Except clause in SQL Server through a couple of practical examples. The Except clause allows us to filter the results of our query, excluding the rows returned by a second query. Let's see how it works with a couple of...
How to get a table structure in SQL Server – Querychat
In this article, we will learn two techniques that will allow us to get a table structure information in SQL Server. We will build a couple of queries that will allow us to obtain a description of a table in SQL Server. We will get information related to the columns...
ORA-06502: numeric or value error – Querychat
In this article, we will see various PL/SQL errors occurring due to incorrect value assignments in Oracle PL/SQL with causes, solutions, and examples. Description: When ora-06502 error occurs, we get the below error message. ora-06502: numeric or value error Cause: When we execute a SQL query statement that results in...
How to work with the Length function in MySQL – Querychat
In this article, we will learn how to use the length function in MySQL to measure the length of a field or a string. MySQL LENGTH function LENGTH function is a native MySQL function that allows us to measure the length of a string or a table field. It has...
How to use SQL Except clause in MySQL – Querychat
MySQL does not support the Except clause, but in this article, we will see how to emulate its functioning. First, let's create a couple of tables that will help us build our example queries. The tables will be called Computer and Repair_Order and will have the following structure and data:...
How To Use Enum Values In MySQL – Querychat
The ENUM value is a valid value from a list of values. In other words, one of the values from a defined list of values forms an ENUM(or enumerated) value. MySQL allows columns to take values from a list of values. In this article, we will look into defining and...
How to Build a CROSS JOIN in SQL Server – Querychat
In this article, we will learn how to build a CROSS JOIN in SQL Server through a simple example. What is a CROSS JOIN? SQL CROSS JOIN clause allows us to make a Cartesian product between two tables. That is if one table has 20 rows and the other has...
How to convert rows into columns in SQL Server – Querychat
In this article, we will learn how to convert rows into columns in SQL Server through a practical example. Transposing rows to columns is very useful when presenting the information. In some circumstances, the information is more readable if we exchange the rows for columns. Let's see it with a...
1 2 21 22