2 min
How to remove duplicate rows in MySQL?
Problem Given a table in MySQL, how do you remove duplicate rows? Input first_name last_name email John Doe [email protected] Jane Smith [email protected] John Doe...
2 min
Problem Given a table in MySQL, how do you remove duplicate rows? Input first_name last_name email John Doe [email protected] Jane Smith [email protected] John Doe...
2 min
Problem How to split values to multiple rows in SQL? Input To illustrate this problem, let’s create a sample input table named “Sales” with...
3 min
Problem You need to calculate a running total in SQL Server and provide a solution that is also reproducible in MySQL. Input To illustrate...
2 min
Problem You need to calculate a running total in SQL Server and provide a solution that is also reproducible in MySQL. Input employee_id first_name...
2 min
Problem How to do a FULL OUTER JOIN in MySQL? Let’s create two example tables, employees and departments, and insert some data into them....
3 min
Problem You want to find the rows that have the maximum value for a specific column within each group in another column. For example,...
2 min
Problem You need to concatenate text from multiple rows into a single text string, for every group present in another column using SQL. For...
2 min
Problem How to switch rows and columns in SQL so that the rows and columns are interchanged? Given a table named Students with columns...
3 min
Problem You have a table with multiple rows of data for each group, and you want to select the last row from each group....
3 min
Problem From the test_scores table below, select the top 1 row in each group. For example, you have a table with data about ‘students’...
3 min
Problem You have a table with multiple rows of data for each group, and you want to select the first row from each group....
2 min
Problem How to transpose columns to rows in SQL? This essentially requires reshaping the table in such a way that certain columns of a...
2 min
Problem How to select only rows with max value on a column for each distinct value in another categorical column in MySQL? From Items...
13 min
SQL window functions exercises is designed to challenge your SQL muscle and help internalize data wrangling using window functions in SQL. The questions are...
5 min
SQL window functions is considered a ‘hard’ concept in SQL. This set of exercises is designed to challenge your SQL muscle and help internalize...
14 min
SQL window functions is one of the advanced concepts, understanding which will give you the ability to do complex data wrangling and transformations in...
7 min
SQL Subquery, also known as inner query or nested query, are used to query data from one or more tables and then used in...
25 min
SQL, short for Structured Query Language is a programming language used to communicate with databases and do various types of Data wrangling operations. This...
Welcome to our comprehensive guide on SQL (Structured Query Language) operators! In this blog post, we’re going to break down the various operators used...
Use of foreign keys in SQL enhances the relationship between tables and ensures data integrity. 1. Introduction to SQL Foreign Key In SQL, a...