PwC SQL Interview Question - STRING_SPLIT(), CROSS APPLY & CROSS JOIN

  Рет қаралды 3,416

Cloud Challengers

Cloud Challengers

Күн бұрын

SQL questions recently asked in PwC interview.
To find out the expected output, I use STRING_SPLIT(), CROSS APPLY & CROSS JOIN
--Create table syntax
CREATE TABLE testtbl (cola VARCHAR(10))
-- Insert data into the table
INSERT INTO testtbl (cola)
VALUES ('1,2'), ('3'), ('4')
For more SQL interview questions. Check out our playlist.
• SQL Interview Questions
Contact us:
info@cloudchallengers.com
Follow us on
Instagram : cloudchallengers
Facebook : cloudchallengers
LinkedIn : linkedin.com/company/cloudchallengers

Пікірлер: 8
@randomshorts2512
@randomshorts2512 23 күн бұрын
with testtbl_cte as( select unnest(string_to_array(cola,',')) as new_col from testtbl), second_part as(select t1.new_col as first,t2.new_col as second from testtbl_cte t1 cross join testtbl_cte t2 where t1.new_col != t2.new_col) select * from second_part where first> second
@sravankumar1767
@sravankumar1767 4 ай бұрын
Superb explanation bro 👌 👏 👍
@002anbarasisanthosh9
@002anbarasisanthosh9 2 ай бұрын
;with cte as ( select * from testtbl cross apply string_split(cola,',')) select a.value as cola,b.value as colab from cte a cross join cte b where b.value
@onemanshow1985
@onemanshow1985 3 ай бұрын
thanks for this videos, can you explain what is the use case for such split with real time scenarios?
@torrentdownloada
@torrentdownloada 4 ай бұрын
with cte as (select *,substring(replace(cola,',',''),1,1) a ,1 as b from testtbl union all select cola,SUBSTRING(replace(cola,',',''),b+1,1) a,b+1 as b from cte where len(replace(cola,',',''))>b) ,cte1 as( select cast(a as int) as col_a ,cast(a as int) as colb from cte union all select col_a,colb-1 from cte1 where colb >1) select * from cte1 where col_acolb order by 1,2
@Naveenkumar-vj2kh
@Naveenkumar-vj2kh 4 ай бұрын
with cte1 as (select value as cola from pwc cross apply string_split(cola,',')), cte2 as (select value colb from pwc cross apply string_split(cola,',')) select * from cte1 join cte2 on cte1.cola>cte2.colb order by 1
ПОДРИФТИЛ С БАБУЛЕЙ #shorts
00:22
Паша Осадчий
Рет қаралды 2,3 МЛН
Делаем с Никой слово LOVE !
00:43
Привет, Я Ника!
Рет қаралды 4,5 МЛН
КОТЁНОК МНОГО ПОЁТ #cat
00:21
Лайки Like
Рет қаралды 2,8 МЛН
哈莉奎因被吓到了#Cosplay
00:20
佐助与鸣人
Рет қаралды 32 МЛН
WordPress Staging & Deployment Guide (GitHub Actions Workflow)
37:12
DBS Bank SQL Interview Question - Find the missing weeks in a table
9:11
Ecolab SQL Interview Question - SUBSTRING() and CHARINDEX() Functions
9:57
Cloud Challengers
Рет қаралды 4,3 М.
Pass Your PwC Interview | PwC Video Interview [2024]
29:44
Job Ready English
Рет қаралды 28 М.
7 Database Design Mistakes to Avoid (With Solutions)
11:29
Database Star
Рет қаралды 101 М.
ПОДРИФТИЛ С БАБУЛЕЙ #shorts
00:22
Паша Осадчий
Рет қаралды 2,3 МЛН