Basic SQL Queries

Basic SQL Queries

Learn the Basic SQL Queries on Concatly!

The SQL SELECT Query retrieves or fetches data from the database. We can fetch an entire table or a set of columns using the query. It stores the data in a result table. In this article, we will discuss the SQL SELECT Query. Also, we will discuss a few examples ...
Read More
The SQL DISTINCT Clause along with the SELECT Query fetches only the unique values of a column or a combination of columns. It is helpful when there are duplicate values in a table and you want to select only the unique ones. In this article, we will discuss the SQL ...
Read More
The ORDER BY statement in SQL sorts the rows in ascending or descending order according to one or more columns. By default, it sorts the rows in ascending order. However, we can also sort the rows in descending order by using the DESC keyword. In this article, we will discuss ...
Read More
The SQL WHERE Condition filters record from the table by using a specified condition. The query using where condition returns only those records which fulfill some conditions. Also, you can not only use it with SQL SELECT but also in UPDATE and DELETE statements. In this article, we will discuss ...
Read More
IS NULL is an operator in SQL which can check for fields having no value (or empty value). You cannot use the comparison operators (=, !=) to check for null values. Instead, you need to use IS NULL or IS NOT NULL operator for checking fields which have no value ...
Read More
SQL INSERT INTO Query inserts new rows in a table in an SQL database. It adds new rows by specifying the column values for each row. In this article, we will discuss the INSERT INTO Query in SQL. Also, we will discuss a few examples of writing SQL INSERT Queries ...
Read More
The UPDATE Query in SQL updates existing records in the table. You can update a single as well as multiple columns using the query. Also, we can specify which rows to update by using the WHERE Clause. In this article, we will discuss SQL UPDATE Query. Also, we will discuss ...
Read More
The DELETE Query in SQL deletes existing records in the table. You can delete a single as well as multiple records according to the condition. Also, we can specify which rows to delete by using the WHERE Condition. In this article, we will discuss the SQL DELETE Query. Also, we ...
Read More
SQL MIN is an inbuilt function in SQL Server. It returns the smallest value of a column in a table. It finds the record which has the minimum value in a recordset. In this article, we will discuss the SQL MIN Function. Also, we will discuss an example of using ...
Read More
SQL MAX is an inbuilt function in SQL Server. It returns the largest value of a column in a table. It finds the record which has the maximum value in a recordset. In this article, we will discuss the SQL MAX Function. Also, we will discuss an example of using ...
Read More
SQL Count is an inbuilt function in SQL Server. It returns the count of the number of rows matching criteria. Also, it can return the count of all the rows in the table if you don't specify any criteria. In this article, we will discuss the SQL Count Function. Also, ...
Read More
SQL AVG is an inbuilt function in SQL Server. It returns the average of a particular field/column in the rows matching criteria. Also, it can return the average of all the fields of all rows in the table if you don't specify any criteria. In this article, we will discuss ...
Read More
The SQL IN Operator allows us to specify multiple values in the WHERE Condition. It removes the need for multiple OR conditions in queries. Therefore, you can provide a list of values to search in the table. In this article, we will discuss the IN Operator in SQL. Also, we ...
Read More
SQL BETWEEN is an inbuilt operator in SQL Server. It returns the rows within a given range of a certain column. You can use it with the WHERE Condition in the query. Also, the values can be numbers, text or timestamp. In this article, we will discuss the SQL BETWEEN ...
Read More
Aliases in SQL are temporary names you can give to a table or column for a particular SQL Query. They are useful when original names are very big or not readable. However, the temporary name only exists for the duration of the query. In this article, we will discuss SQL ...
Read More
SQL INNER JOIN statement selects data present in both (or more) tables according to the common field between them. It matches all the rows in table 1 with all the rows with table 2 for the JOIN condition and returns all the pair of rows which match the criteria. Therefore, ...
Read More
SQL LEFT JOIN statement returns all the records present in the left table and matched records from the right table. However, the result will contain null for the rows which are not present in the right table. In this article, we will discuss the SQL LEFT JOIN Statement. Also, we ...
Read More
SQL RIGHT JOIN statement returns all the records present in the right table and matched records from the left table. However, the result will contain null for the rows which are not present in the left table. In this article, we will discuss the SQL RIGHT JOIN Statement. Also, we ...
Read More
The SQL UNION operator combines the result of two or more SQL SELECT queries and returns the combined result of the queries as a union. In this article, we will discuss the SQL Union Clause. Also, we will discuss a few examples of using it. Syntax SELECT column1, column2 ...
Read More