Easy way to get 15 free YouTube views, likes and subscribers
Get Free YouTube Subscribers, Views and Likes

Solving SQL Query | Rows to Column in SQL

Follow
techTFQ

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:
Blog: https://techtfq.com/video/solvingsql...
Discord:   / discord  

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:
Email id: [email protected]

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  Basic concepts  

✅ SQL Tutorial Intermediate concepts:
   • SQL Tutorial  Intermediate concepts  

✅ SQL Tutorial Advance concepts:
   • SQL Tutorial  Advance concepts  

✅ Practice Solving Basic SQL Queries:
   • Practice Solving BASIC SQL Queries  

✅ Practice Solving Intermediate SQL Queries:
   • Practice Solving INTERMEDIATE SQL Que...  

✅ Practice Solving Complex SQL Queries:
   • Practice Solving COMPLEX SQL Queries  

✅ Data Analytics Career guidance:
   • Data Analytics career and more  

✅ SQL Course, SQL Training Platform Recommendations:
   • SQL Course / Training  

✅ Python Tutorial:
   • Python Tutorial  

THANK YOU,
Thoufiq

posted by Garliny9