Posts Tagged with 'SQL'

Introduction Retrieving data based on time intervals, such as monthly or yearly, is a common requirement in web applications. This article explains how to query a MySQL table to fetch records for a specific month …

Last updated 1 month ago | 54 views

Tags:- SQL MySQL

When working with SQL, you might need to filter grouped results after performing a COUNT() operation. The HAVING clause is essential for this task, as it allows filtering after grouping the data. ✅ SQL Query …

Last updated 1 month ago | 56 views

Tags:- SQL MySQL

When working with databases, there are situations where you need to retrieve rows from one table that do not have corresponding values in another table. This can be achieved efficiently using either the NOT IN …

Last updated 1 month ago | 48 views

Tags:- SQL MySQL

SQL | Compare timestamp with date only Timestamp holds Date and Time both with 19 characters. To filter table record with the only date parameter can be achieved by SQL DATE() function. Consider the Employee table …

Last updated 4 years, 11 months ago | 1965 views

Tags:- SQL MySQL

SQL | Timestamp in where clause to select the date range Select date range from the timestamp column with where clause can be done by using the BETWEEN operator. BETWEEN Operator : The BETWEEN operator selects …

Last updated 4 years, 11 months ago | 1838 views

Tags:- SQL MySQL

SQL | Foreign Key A foreign key is a key used to link two tables.    A Primary key of a table is used as a foreign key for the other table. The primary key …

Last updated 5 years, 11 months ago | 2063 views

Tags:- SQL MySQL

SQL | View View in SQL is a kind of virtual table. It does not physical exists in our database but have rows and column as there we have in a real database table. we …

Last updated 5 years, 11 months ago | 2244 views

Tags:- SQL MySQL

SQL | Difference between primary key and unique constraints There is only one primary key in a table. It creates the clustered index automatically and it cannot have NULL value whereas there can be multiple …

Last updated 5 years, 11 months ago | 1650 views

Tags:- SQL MySQL

SQL | LIKE operator The LIKE operator of SQL is used for such kind of operations. It is used to fetch filtered data by searching for a particular pattern in where clause.   The Syntax for …

Last updated 5 years, 11 months ago | 3200 views

Tags:- SQL MySQL

SQL | difference between BETWEEN and IN operator The BETWEEN operator selects all records between the given range whereas IN operator selects all matching records given with the WHERE clause.   BETWEEN operator The Between operator in …

Last updated 5 years, 11 months ago | 6514 views

Tags:- SQL MySQL

By using following query we can find out the nth largest salary from employees table. SELECT salary FROM `employees` ORDER BY salary DESC LIMIT 1 OFFSET n-1 In the above query n is replaced by …

Last updated 6 years ago | 1980 views

Tags:- SQL MySQL

SQL Update statement The UPDATE statement is used to update the records of an existing table in a database. We can update single as well as multiple columns using SQL update statement. The basic syntax …

Last updated 6 years, 2 months ago | 2080 views

Tags:- SQL MySQL

OPTIMIZE command is use for optimize a table. OPTIMIZE TABLE `users`  

Last updated 6 years, 7 months ago | 2030 views

Tags:- SQL