TRICKY SQL Interview Question | SQL Intermediate Question 20

Поделиться
HTML-код
  • Опубликовано: 29 апр 2024
  • Question - Write an SQL query 𝐭𝐨 𝐟𝐢𝐧𝐝 𝐭𝐡𝐞 𝐭𝐱𝐧𝐦𝐨𝐧𝐭𝐡 𝐰𝐡𝐢𝐜𝐡 𝐡𝐚𝐬 𝐭𝐡𝐞 𝐦𝐚𝐱𝐢𝐦𝐮𝐦 𝐭𝐱𝐧𝐚𝐦𝐨𝐮𝐧𝐭
    The approach is to arrange the data vertically so that applying aggerate functions becomes easy.
    Comment below yours approach too.
    create table eshop(txnmonth varchar(50),clothing int,electronics int,sports int);
    insert into eshop values('Jan',2000,1500,3000);
    insert into eshop values('Feb',1000,2500,4000);
    insert into eshop values('Mar',2000,1400,1000);
    insert into eshop values('Apr',3000,1500,1000);
    select * from eshop;
    #amazon #facebook #meta #ai #dataanalytics #placement #college #sql #tcs #cts #infosys

Комментарии • 7