filmov
tv
Solving SQL Query | Rows to Column in SQL
Показать описание
In this video, we will solve an SQL Query where we will need to transform data from rows to column.
We can transform data from rows to column in SQL using PIVOT operator but not all RDBMS supports PIVOT. Microsoft SQL Server and Oracle supports PIVOT operator, whereas in PostgreSQL, we can transform rows to column using CROSSTAB function. Similarly in MySQL database, rows to column transformation can be done using the CASE statement.
Hence in this video, we shall first look at the SQL query problem statement. We understand the input data and also understand the expected output. After this we shall write SQL query to solve this problem using PIVOT in Microsoft SQL Server and in Oracle.
We shall then solve the same problem in PostgreSQL database using CROSSTAB function. Finally we shall also solve this query in MySQL database using the CASE statement.
All the datasets, scripts and SQL queries used in this video can be downloaded from my blog and from my discord channel. Links below:
If you would like to share any interesting SQL query with me so that I can make a video about it then do share them in the email below:
Timestamp:
00:00 Intro
01:58 Understanding the SQL Query Problem statement
04:20 Solving SQL Query in Microsoft SQL Server using PIVOT
26:59 Solving SQL Query in Oracle using PIVOT
32:46 Solving SQL Query in PostgreSQL using CROSSTAB
55:31 Solving SQL Query in MySQL using CASE statement
🔴 WATCH MORE VIDEOS HERE 👇
✅ SQL Tutorial - Basic concepts:
✅ SQL Tutorial - Intermediate concepts:
✅ SQL Tutorial - Advance concepts:
✅ Practice Solving Basic SQL Queries:
✅ Practice Solving Intermediate SQL Queries:
✅ Practice Solving Complex SQL Queries:
✅ Data Analytics Career guidance:
✅ SQL Course, SQL Training Platform Recommendations:
✅ Python Tutorial:
THANK YOU,
Thoufiq
We can transform data from rows to column in SQL using PIVOT operator but not all RDBMS supports PIVOT. Microsoft SQL Server and Oracle supports PIVOT operator, whereas in PostgreSQL, we can transform rows to column using CROSSTAB function. Similarly in MySQL database, rows to column transformation can be done using the CASE statement.
Hence in this video, we shall first look at the SQL query problem statement. We understand the input data and also understand the expected output. After this we shall write SQL query to solve this problem using PIVOT in Microsoft SQL Server and in Oracle.
We shall then solve the same problem in PostgreSQL database using CROSSTAB function. Finally we shall also solve this query in MySQL database using the CASE statement.
All the datasets, scripts and SQL queries used in this video can be downloaded from my blog and from my discord channel. Links below:
If you would like to share any interesting SQL query with me so that I can make a video about it then do share them in the email below:
Timestamp:
00:00 Intro
01:58 Understanding the SQL Query Problem statement
04:20 Solving SQL Query in Microsoft SQL Server using PIVOT
26:59 Solving SQL Query in Oracle using PIVOT
32:46 Solving SQL Query in PostgreSQL using CROSSTAB
55:31 Solving SQL Query in MySQL using CASE statement
🔴 WATCH MORE VIDEOS HERE 👇
✅ SQL Tutorial - Basic concepts:
✅ SQL Tutorial - Intermediate concepts:
✅ SQL Tutorial - Advance concepts:
✅ Practice Solving Basic SQL Queries:
✅ Practice Solving Intermediate SQL Queries:
✅ Practice Solving Complex SQL Queries:
✅ Data Analytics Career guidance:
✅ SQL Course, SQL Training Platform Recommendations:
✅ Python Tutorial:
THANK YOU,
Thoufiq
Комментарии