Data Sculptor
Data Sculptor
  • 105
  • 50 424

Відео

SQL INTERVIEW QUESTION | Advanced aggregation using GROUPINGSETS FunctionSQL INTERVIEW QUESTION | Advanced aggregation using GROUPINGSETS Function
SQL INTERVIEW QUESTION | Advanced aggregation using GROUPINGSETS Function
Переглядів 177День тому
DML Script:datasculptor.blogspot.com/2024/07/advanced-sql-techniques-master-rollup.html Feedback: forms.gle/NQuCAy7p5a9wxW3LA The Data Sculptor UA-cam channel is a dedicated platform that explores the art and science of working with data. This channel caters to a diverse audience, including data enthusiasts, analysts, scientists, and anyone interested in harnessing the power of data for insight...
My office vlog | INTEL SRR campus | First VlogMy office vlog | INTEL SRR campus | First Vlog
My office vlog | INTEL SRR campus | First Vlog
Переглядів 502 дні тому
SQL INTERVIEW QUESTION | Advanced aggregation using CUBESQL INTERVIEW QUESTION | Advanced aggregation using CUBE
SQL INTERVIEW QUESTION | Advanced aggregation using CUBE
Переглядів 5063 дні тому
DML Script: datasculptor.blogspot.com/2024/07/advanced-sql-techniques-master-rollup.html Feedback: forms.gle/NQuCAy7p5a9wxW3LA The Data Sculptor UA-cam channel is a dedicated platform that explores the art and science of working with data. This channel caters to a diverse audience, including data enthusiasts, analysts, scientists, and anyone interested in harnessing the power of data for insigh...
SQL INTERVIEW QUESTION | Advanced aggregation using ROLLUPSQL INTERVIEW QUESTION | Advanced aggregation using ROLLUP
SQL INTERVIEW QUESTION | Advanced aggregation using ROLLUP
Переглядів 2175 днів тому
DML Script: datasculptor.blogspot.com/2024/07/advanced-sql-techniques-master-rollup.html Feedback: forms.gle/NQuCAy7p5a9wxW3LA The Data Sculptor UA-cam channel is a dedicated platform that explores the art and science of working with data. This channel caters to a diverse audience, including data enthusiasts, analysts, scientists, and anyone interested in harnessing the power of data for insigh...
SQL Interview question | Calculate 90th discrete percentile of each region | SQLSQL Interview question | Calculate 90th discrete percentile of each region | SQL
SQL Interview question | Calculate 90th discrete percentile of each region | SQL
Переглядів 4196 днів тому
DML Script: datasculptor.blogspot.com/2024/07/sql-interview-question-calculate-90th.html Feedback: forms.gle/NQuCAy7p5a9wxW3LA The Data Sculptor UA-cam channel is a dedicated platform that explores the art and science of working with data. This channel caters to a diverse audience, including data enthusiasts, analysts, scientists, and anyone interested in harnessing the power of data for insigh...
INTEL INTERVIEW QUESTION | Showing Sales Amount by Order Date and Ship Date | DAXINTEL INTERVIEW QUESTION | Showing Sales Amount by Order Date and Ship Date | DAX
INTEL INTERVIEW QUESTION | Showing Sales Amount by Order Date and Ship Date | DAX
Переглядів 4407 днів тому
Feedback: forms.gle/NQuCAy7p5a9wxW3LA The Data Sculptor UA-cam channel is a dedicated platform that explores the art and science of working with data. This channel caters to a diverse audience, including data enthusiasts, analysts, scientists, and anyone interested in harnessing the power of data for insightful and creative purposes. The channel covers a wide range of topics related to data man...
ORACLE INTERVIEW QUESTION | How to Assign Row Numbers Without ROW_NUMBER() FunctionORACLE INTERVIEW QUESTION | How to Assign Row Numbers Without ROW_NUMBER() Function
ORACLE INTERVIEW QUESTION | How to Assign Row Numbers Without ROW_NUMBER() Function
Переглядів 5398 днів тому
DML Script: datasculptor.blogspot.com/2024/07/oracle-interview-question-how-to-assign.html Feedback: forms.gle/NQuCAy7p5a9wxW3LA The Data Sculptor UA-cam channel is a dedicated platform that explores the art and science of working with data. This channel caters to a diverse audience, including data enthusiasts, analysts, scientists, and anyone interested in harnessing the power of data for insi...
SQL INTERVIEW QUESTION | Join 3 Tables & Filter Records in 2 Tables Only | SQLSQL INTERVIEW QUESTION | Join 3 Tables & Filter Records in 2 Tables Only | SQL
SQL INTERVIEW QUESTION | Join 3 Tables & Filter Records in 2 Tables Only | SQL
Переглядів 5699 днів тому
DML Script: datasculptor.blogspot.com/2024/07/sql-interview-question-join-3-tables.html Feedback: forms.gle/NQuCAy7p5a9wxW3LA The Data Sculptor UA-cam channel is a dedicated platform that explores the art and science of working with data. This channel caters to a diverse audience, including data enthusiasts, analysts, scientists, and anyone interested in harnessing the power of data for insight...
Calculate 90th continuous percentile of each region | SQL | SQL Interview questionCalculate 90th continuous percentile of each region | SQL | SQL Interview question
Calculate 90th continuous percentile of each region | SQL | SQL Interview question
Переглядів 1,2 тис.11 днів тому
DML Script: datasculptor.blogspot.com/2024/07/ey-interview-question-calculate-90th.html Feedback: forms.gle/NQuCAy7p5a9wxW3LA The Data Sculptor UA-cam channel is a dedicated platform that explores the art and science of working with data. This channel caters to a diverse audience, including data enthusiasts, analysts, scientists, and anyone interested in harnessing the power of data for insight...
ACCENTURE INTERVIEW QUESTION | Rank products based on revenue | DAXACCENTURE INTERVIEW QUESTION | Rank products based on revenue | DAX
ACCENTURE INTERVIEW QUESTION | Rank products based on revenue | DAX
Переглядів 52811 днів тому
Feedback: forms.gle/NQuCAy7p5a9wxW3LA The Data Sculptor UA-cam channel is a dedicated platform that explores the art and science of working with data. This channel caters to a diverse audience, including data enthusiasts, analysts, scientists, and anyone interested in harnessing the power of data for insightful and creative purposes. The channel covers a wide range of topics related to data man...
EY INTERVIEW QUESTION | Categorize Salespersons by Sales Amount in SQLEY INTERVIEW QUESTION | Categorize Salespersons by Sales Amount in SQL
EY INTERVIEW QUESTION | Categorize Salespersons by Sales Amount in SQL
Переглядів 1,1 тис.13 днів тому
DML Script: datasculptor.blogspot.com/2024/07/ey-interview-question-categorize.html Feedback: forms.gle/NQuCAy7p5a9wxW3LA The Data Sculptor UA-cam channel is a dedicated platform that explores the art and science of working with data. This channel caters to a diverse audience, including data enthusiasts, analysts, scientists, and anyone interested in harnessing the power of data for insightful ...
ADOBE SQL INTERVIEW QUESTION | Divide Employees into BucketsADOBE SQL INTERVIEW QUESTION | Divide Employees into Buckets
ADOBE SQL INTERVIEW QUESTION | Divide Employees into Buckets
Переглядів 1 тис.15 днів тому
DML Script: datasculptor.blogspot.com/2024/07/adobe-sql-interview-question-divide.html Feedback: forms.gle/NQuCAy7p5a9wxW3LA The Data Sculptor UA-cam channel is a dedicated platform that explores the art and science of working with data. This channel caters to a diverse audience, including data enthusiasts, analysts, scientists, and anyone interested in harnessing the power of data for insightf...
DAX Tutorial: SUM vs. SUMX - Get Your Calculations Right!DAX Tutorial: SUM vs. SUMX - Get Your Calculations Right!
DAX Tutorial: SUM vs. SUMX - Get Your Calculations Right!
Переглядів 5716 днів тому
Feedback: forms.gle/NQuCAy7p5a9wxW3LA The Data Sculptor UA-cam channel is a dedicated platform that explores the art and science of working with data. This channel caters to a diverse audience, including data enthusiasts, analysts, scientists, and anyone interested in harnessing the power of data for insightful and creative purposes. The channel covers a wide range of topics related to data man...
AMAZON INTERVIEW QUESTION | Dynamic Score Calculation Without Updates | SQL INTERVIEWAMAZON INTERVIEW QUESTION | Dynamic Score Calculation Without Updates | SQL INTERVIEW
AMAZON INTERVIEW QUESTION | Dynamic Score Calculation Without Updates | SQL INTERVIEW
Переглядів 54917 днів тому
DML Script: datasculptor.blogspot.com/2024/07/amazon-interview-question-dynamic-score.html Feedback: forms.gle/NQuCAy7p5a9wxW3LA The Data Sculptor UA-cam channel is a dedicated platform that explores the art and science of working with data. This channel caters to a diverse audience, including data enthusiasts, analysts, scientists, and anyone interested in harnessing the power of data for insi...
INTEL INTERVIEW QUESTION: Mastering SELECTCOLUMNS vs ADDCOLUMNS in DAX!INTEL INTERVIEW QUESTION: Mastering SELECTCOLUMNS vs ADDCOLUMNS in DAX!
INTEL INTERVIEW QUESTION: Mastering SELECTCOLUMNS vs ADDCOLUMNS in DAX!
Переглядів 11218 днів тому
Feedback: forms.gle/NQuCAy7p5a9wxW3LA The Data Sculptor UA-cam channel is a dedicated platform that explores the art and science of working with data. This channel caters to a diverse audience, including data enthusiasts, analysts, scientists, and anyone interested in harnessing the power of data for insightful and creative purposes. The channel covers a wide range of topics related to data man...

КОМЕНТАРІ

  • @Hope-xb5jv
    @Hope-xb5jv День тому

    but you not explain how you sort product like A,A,A,B,B,B,null,null,null my solution :- WITH cte AS ( SELECT product, region, SUM(sales) OVER(PARTITION BY product ORDER BY sales) AS r, ROW_NUMBER() OVER(PARTITION BY product ORDER BY sales DESC) AS rn FROM sales_rollup ) SELECT product, NULL AS region, r AS total_sales FROM cte WHERE rn = 1 UNION ALL SELECT NULL AS product, region, SUM(sales) AS total_sales FROM sales_rollup GROUP BY region UNION ALL SELECT NULL AS product, NULL AS region, SUM(sum_r) AS total_sales FROM ( SELECT region, SUM(sales) AS sum_r FROM sales_rollup GROUP BY region ) a UNION ALL SELECT product, region, SUM(sales) OVER(PARTITION BY product ORDER BY sales) AS total_sales FROM sales_rollup (i'm thinking to create temporary table then put all things in it after that sort )

    • @datasculptor2895
      @datasculptor2895 День тому

      This isn’t guaranteed to give you the same sort result every-time.

    • @Hope-xb5jv
      @Hope-xb5jv День тому

      @@datasculptor2895 it's not about guarantee it's question how we get exact output including order by Here we are sharing knowledge and practice SQL so in interview may be interviewer ask i want exact same output (then what will you say ?)

    • @datasculptor2895
      @datasculptor2895 День тому

      That’s what my question is. How will your query return the output in the required sort order without using order by?

    • @Hope-xb5jv
      @Hope-xb5jv 23 години тому

      @@datasculptor2895 no, my query not return exact output ( not in order by) This things i mentioned in last line i can create one temporary table in which put this output then call temporary table output with order by (using case) This is my logic What's your?? I asked

    • @datasculptor2895
      @datasculptor2895 23 години тому

      Yes. Need not put in temporary table. You can use the order by directly in the query using case statement

  • @edgydodgy3417
    @edgydodgy3417 2 дні тому

    Awesome! Content It requires a lot of hardwork for producing the content. Thankyou so much

  • @juwoden6563
    @juwoden6563 2 дні тому

    Interesting

  • @chandanpatra1053
    @chandanpatra1053 2 дні тому

    Are you working as a data engineer in Intel? Are you from NIT/IIT ? If no then share your journey how you reached there. If yes then ignore.

    • @datasculptor2895
      @datasculptor2895 2 дні тому

      Yes, I work as a data engineer in Intel. I am from VIT Vellore.

    • @DE_Pranav
      @DE_Pranav 2 дні тому

      ​@@datasculptor2895 Hello, how much exp do you have as data engineer?

    • @datasculptor2895
      @datasculptor2895 2 дні тому

      @@DE_Pranav 8+ years

  • @bollyhome6650
    @bollyhome6650 2 дні тому

    Cant we do this by two inner join's it will give common between all three tables

  • @animesh7296
    @animesh7296 3 дні тому

    Hi, Please check the below scenario, as i'm getting different answer from my approach. For Ride = 10, it was requested_at 2020-03-04 and driver = 7 joined at 2020-03-08. Meaning only 3 drivers were available for ride_id 10 namely 10, 8, 5. Below is my approach. with RideCNT as ( Select CONVERT(varchar(6), R.requested_at, 112) as [YearMonth] , COUNT(R.ride_id) as RideReqCNT , COUNT(AR.ride_id) as RideAcceptCNT from Rides R LEFT JOIN AcceptedRides AR ON R.ride_id = AR.ride_id GROUP BY CONVERT(varchar(6), R.requested_at, 112) -- ORDER BY 1 ) , DriverCNT as ( Select CONVERT(nvarchar(6), R.requested_at, 112) As YearMonth , COUNT(DISTINCT R.ride_id) as RideReqCNT , COUNT(distinct driver_id) as DriverAvailCNT from Rides R LEFT JOIN Drivers D ON R.requested_at >= D.join_date GROUP BY CONVERT(nvarchar(6), requested_at, 112) ) Select A.YearMonth, A.RideReqCNT, B.DriverAvailCNT, A.RideAcceptCNT , CASE WHEN DriverAvailCNT = 0 THEN 0 ELSE RideAcceptCNT * 100.0 / DriverAvailCNT END AS working_percentage from RideCNT A INNER JOIN DriverCNT B ON A.YearMonth = B.YearMonth;

  • @deepakj6717
    @deepakj6717 3 дні тому

    SELECT COALESCE( a.Id , b.Id) AS ID , CASE WHEN a.Name != b.Name THEN 'Source Mismatch' WHEN a.Name IS NULL THEN 'New In Target' WHEN b.Name IS NULL THEN 'New In Source' END as Comment FROM Source a FULL OUTER JOIN Target b ON a.Id = b.Id WHERE CASE WHEN a.Name != b.Name THEN 'Source Mismatch' WHEN a.Name IS NULL THEN 'New In Target' WHEN b.Name IS NULL THEN 'New In Source' END IS NOT NULL

  • @Manifestion_kannada
    @Manifestion_kannada 4 дні тому

    Solve more questions on join and analytical functions

  • @animesh7296
    @animesh7296 5 днів тому

    Hi, while using UNION ALL method to get the result in required format. I use below method. with cte as ( Select Product, Region, Sales AS TotalSales from Sales UNION ALL Select Product, NULL as Region , SUM(Sales) AS TotalSales From Sales GROUP BY Product UNION ALL Select Null as Product, NULL as Region , SUM(Sales) AS TotalSales From Sales ) Select * from cte Order by (CASE WHEN Product IS NULL THEN 'zz' ELSE Product END), (CASE WHEN Region IS NULL THEN 'zz' ELSE Region END);

  • @vijaygupta7059
    @vijaygupta7059 5 днів тому

    Please bring more real-time power BI interview questions, like you do for SQL

  • @MusicalShorts-hn1px
    @MusicalShorts-hn1px 5 днів тому

    Thanks for the new approach...

  • @animesh7296
    @animesh7296 5 днів тому

    Hi, Below is my Solution. Please check your query result, as when i ran with 14 matches, there is some descrepency at winning_% and sequencing of teams For me, KKR > GT is coming. Declare @MN INT = 14; with teams as ( Select TeamA As[Team] from IPLResults UNION Select TeamB As[Team] from IPLResults ) , cte as ( Select TeamA as [Team], WinningTeam from IPLResults WHERE MatchN <= @MN UNION ALL Select TeamB, WinningTeam from IPLResults WHERE MatchN <= @MN ) , cte_final as ( Select T.Team , Count(CT.Team) as Played , SUM(CASE WHEN T.Team = CT.WinningTeam THEN 1 ELSE 0 END) AS Win , SUM(CASE WHEN T.Team <> CT.WinningTeam AND CT.WinningTeam <> 'NA' THEN 1 ELSE 0 END) AS Loss , SUM(CASE WHEN CT.WinningTeam = 'NA' THEN 1 ELSE 0 END) AS Draw from teams T LEFT JOIN cte CT ON T.Team = CT.Team Group by T.Team ) Select * , Win * 2 + Draw*1 as Points , Win *100.0 / Played as [Winning %] from cte_final Order by Points desc, [Winning %] DESC;

  • @chandanpatra1053
    @chandanpatra1053 6 днів тому

    Really a brain storming question in powerBI . Thanks for bringing up such questions. Keep it up. 👍👍. It would be better if you provide those excel datasets gdrive link for our practice purpose .

  • @anirbanbiswas7624
    @anirbanbiswas7624 6 днів тому

    simple approach----- with cte as (select a.id as id,a.valuea as vals from tablea2 as a join tableb as b on a.id=b.id and a.valuea=b.valueb), cte2 as(select b.id as id,b.valueb as vals from tableb as b join tablec as c on b.id=c.id and b.valueb=c.valuec) select c1.* from cte as c1 left join cte2 as c2 on c1.id=c2.id

    • @datasculptor2895
      @datasculptor2895 6 днів тому

      Will this work if there is a common entry in all the 3 tables?

  • @debanjanabiswas8040
    @debanjanabiswas8040 6 днів тому

    Glad to know

  • @UnrealAdi
    @UnrealAdi 6 днів тому

    Hello bud, are we under the strict instructions to only 'JOIN' the tables or would it be ok to use 'Union'? Also, may I know where was this interview question asked? Thanks for the continuous content uploads, it helps a ton of folks!

    • @datasculptor2895
      @datasculptor2895 6 днів тому

      I do not remember where this was asked, but the question was to achieve results using joins

  • @Sirigineedi_Navann
    @Sirigineedi_Navann 7 днів тому

    Nice one brother keep up the great work 😊

    • @datasculptor2895
      @datasculptor2895 7 днів тому

      Thanks. Please like and subscribe to my channel

  • @animesh7296
    @animesh7296 7 днів тому

    Hi, Below is my approach. with cte as ( Select A.AttemptID, A.PlayerID, A.Score , MAX(CASE When B.AttemptID = 1 THEN A.Score - B.Score END) AS [Different First] , MAX(CASE When B.AttemptID = 3 THEN A.Score - B.Score END) AS [Different Last] , MAX(CASE WHEN A.AttemptID = 1 THEN 1 WHEN A.AttemptID = B.AttemptID + 1 AND A.Score >= B.Score THEN 1 ELSE 0 END ) AS [Is Previous Score Lower] from PlayerScores A INNER JOIN PlayerScores B ON A.PlayerID= B.PlayerID GROUP BY A.AttemptID, A.PlayerID, A.Score -- Order by A.PlayerID, A.AttemptID ) , cte_IMprv as ( Select PlayerID, CASE WHEN COUNT(AttemptID) = SUM([Is Previous Score Lower]) Then 1 ELSE 0 END AS [Is OverAll Improved] from cte group by PlayerID ) Select M.*, IM.[Is OverAll Improved] from cte M LEFT JOIN cte_IMprv IM ON M.PlayerID = IM.PlayerID Order by PlayerID, AttemptID

  • @vijaygupta7059
    @vijaygupta7059 8 днів тому

    I use other window function SELECT *,DENSE_RANK()over(partition by department_id order by name) as rn FROM employees order by employee_id

    • @datasculptor2895
      @datasculptor2895 8 днів тому

      Nice, but intention was to not use any window functions.

  • @anilkumark3573
    @anilkumark3573 8 днів тому

    select i.a, i.b, sum(case when e.a = i.a and e.b = i.a then e.shipments + i.shipments end) as total_shipments from exp_imp e join exp_imp i on e.a = i.b and e.b = i.a and e.shipments < i.shipments group by i.a, i.b

  • @devendrabarasker4987
    @devendrabarasker4987 9 днів тому

    is this a right approach using join? with cte as( select a.ID as id1,a.ValueA,b.ID as id2,b.ValueB,c.ID as id3,c.ValueC,case when a.ID=b.ID and a.ValueA=b.ValueB then 0 when b.ID=c.ID and b.ValueB=c.ValueC then 1 when c.ID=a.ID and c.ValueC=a.ValueA then 2 end flag, coalesce (case when a.ID=b.ID and b.ID=c.ID then 5 end,4) flag2 from TableA a FULL join TableB b on a.ID=b.ID AND A.ValueA=B.ValueB full join TableC c on b.ID=c.ID and b.ValueB=c.ValueC full join TableA aa on c.ID=aa.ID and c.ValueC=aa.ValueA )select id2,valueb from cte where flag2<>5 and flag in (0,1)

    • @datasculptor2895
      @datasculptor2895 9 днів тому

      Yes. Please subscribe to my channel

    • @devendrabarasker4987
      @devendrabarasker4987 9 днів тому

      @@datasculptor2895 already i subscribed it bro you are making excellent content 🙌🙌

    • @datasculptor2895
      @datasculptor2895 8 днів тому

      @@devendrabarasker4987 Happy that you are liking my content. More interesting questions coming. Meanwhile you can let me know if you are looking out for any topics or questions.

    • @devendrabarasker4987
      @devendrabarasker4987 8 днів тому

      @@datasculptor2895 power bi advanced level if possible...

    • @datasculptor2895
      @datasculptor2895 8 днів тому

      @@devendrabarasker4987 Sure.. definitely.

  • @monasanthosh9208
    @monasanthosh9208 9 днів тому

    Select salesrepid from (Select *,count(Salesrepid) as CNTfrom (Select * from (Select SalesrepId,row_Number() over (Partition by Salesrepid,SalesType) as RN from Orders)N where RN = 1) group by Salesrepid)N where CNT=1

  • @monasanthosh9208
    @monasanthosh9208 9 днів тому

    Select *,Case When Amount=Min(Amount) over (Partition by Sales_person Order by Amount asc) Then "Lowest" When Amount=Max(Amount) over (Partition by Sales_person Order by Amount Desc) Then "Highest" When Amount=Avg(Amount) over (Partition by Sales_person Range between unbounded preceding and unbounded following) Then "Average" When Amount>Avg(Amount) over (Partition by Sales_person Range between unbounded preceding and unbounded following) Then "Above Average" When Amount<Avg(Amount) over (Partition by Sales_person Range between unbounded preceding and unbounded following) Then "Below Average" end as Category from sale order by Sales_person,amount;

  • @harshbhoyar7176
    @harshbhoyar7176 9 днів тому

    is this correct ? with cte as ( SELECT a.id , a.ValueA FROM TABLEA A JOIN TableB B ON A.ID=B.ID AND A.VALUEA=B.VALUEB union select b.ID , b.ValueB from tableb b join tablec c on b.id=c.ID and b.ValueB=c.ValueC union select a.ID, a.ValueA from TableA a join TableC c on a.ID=c.id and a.ValueA=c.ValueC) select * From cte;

    • @datasculptor2895
      @datasculptor2895 9 днів тому

      Unfortunately this will not work. Row common in all the 3 tables will also appear in this

    • @harshbhoyar7176
      @harshbhoyar7176 9 днів тому

      @@datasculptor2895 thanks

  • @monasanthosh9208
    @monasanthosh9208 9 днів тому

    MYSQL Solution Select Name,Marks,Years,Pre_Year from (Select *, Case When Marks>=Pre_Year then 1 else 0 end as Flag from (Select *,Lag(Marks) over (Partition by Name Order by Years) as Pre_Year from Marks)N)N Where Flag=1;

  • @UnrealAdi
    @UnrealAdi 10 днів тому

    MySQL: WITH RankedData AS ( SELECT Region, revenue, ROW_NUMBER() OVER (PARTITION BY Region ORDER BY revenue) AS rn, COUNT(*) OVER (PARTITION BY Region) AS cnt FROM sales2 ), PercentilePositions AS ( SELECT Region, revenue, rn, cnt, 0.9 * (cnt - 1) + 1 AS percentile_pos FROM RankedData ), InterpolatedData AS ( SELECT Region, revenue AS lower_revenue, LEAD(revenue) OVER (PARTITION BY Region ORDER BY revenue) AS upper_revenue, rn, FLOOR(percentile_pos) AS lower_rn, CEIL(percentile_pos) AS upper_rn, percentile_pos FROM PercentilePositions ) SELECT *, CASE WHEN lower_rn = upper_rn THEN lower_revenue ELSE lower_revenue + (upper_revenue - lower_revenue) * (percentile_pos - lower_rn) END AS percentile_90 FROM InterpolatedData WHERE rn = lower_rn -- OR rn = upper_rn ORDER BY Region;

  • @vijaygupta7059
    @vijaygupta7059 10 днів тому

    Thanks for new function, I have learn new function today

  • @Factstelugu5
    @Factstelugu5 10 днів тому

    sql intemediate advanced topics videos/resources cheyyandi bro

    • @datasculptor2895
      @datasculptor2895 10 днів тому

      Sure.. definitely. Please subscribe to my channel.

  • @saiteja-gb8ho
    @saiteja-gb8ho 10 днів тому

    SELECT *, CASE WHEN SALARY >=2000 AND SALARY <=3000 THEN 1 WHEN SALARY >=3500 AND SALARY <=4000 THEN 2 WHEN SALARY >=4500 AND SALARY <=5000 THEN 3 WHEN SALARY >=6000 AND SALARY <=7000 THEN 4 END SALARY_BUCKET FROM EMPLOYEES ORDER BY SALARY

    • @datasculptor2895
      @datasculptor2895 10 днів тому

      Sorry, but this should not be done in this way. What if the salaries are changed in the dataset?

  • @saiteja-gb8ho
    @saiteja-gb8ho 10 днів тому

    WITH CTE AS (SELECT * ,SUM(WEIGHT)OVER(ORDER BY LINEORDER ) AS CUMMSUM FROM ELEVATORORDER) SELECT NAME FROM CTE WHERE CUMMSUM<2000 ORDER BY LINEORDER DESC LIMIT 1

  • @mahenderchilagani5916
    @mahenderchilagani5916 10 днів тому

    with cte as( select*, percent_rank() over(order by salary asc) as rn from employees ) select employee_id, salary, case when rn = 0 then '1' when rn = 0.125 then '1' when rn = 0.25 then '1' when rn = 0.375 then '2' when rn = 0.5 then '2' when rn = 0.625 then '3' when rn = 0.75 then '3' when rn = 0.875 then '4' else '4' end as Bucket from cte

  • @chandanpatra1053
    @chandanpatra1053 10 днів тому

    Good question. Please keep posting such questions on DAX.

  • @sravankumar1767
    @sravankumar1767 11 днів тому

    SELECT Region, PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY Amount) OVER (PARTITION BY Region) AS median_amount FROM Sales;

  • @sravankumar1767
    @sravankumar1767 11 днів тому

    SELECT Region, PERCENTILE_CONT(0.9) WITHIN GROUP (ORDER BY Amount) OVER (PARTITION BY Region) AS percentile_90 FROM table_name;

  • @srivalli5269
    @srivalli5269 11 днів тому

    Well explained without predefined functions

  • @sweetsubha514
    @sweetsubha514 11 днів тому

    Informative 🙂🙂👌👌👌make more such query based questions related to SQL (most important)

    • @datasculptor2895
      @datasculptor2895 11 днів тому

      Thank you. Please subscribe to my channel 🙂

  • @joemoneyweather4437
    @joemoneyweather4437 12 днів тому

    EE is associated with EE and shld not be return, only GG shld b return going by your own logic. Kindly review

    • @datasculptor2895
      @datasculptor2895 12 днів тому

      EE is associated to echo and foxtarr, echo and foxtarr are not associated to any other codes so EE should also return. Hope this clears the confusion.

  • @devendrabarasker4987
    @devendrabarasker4987 12 днів тому

    Here is my approach but i want to know if i don't use cte will there be any performance issue...? select top 2 DATENAME(dw,timestamp)dw,case when format(timestamp,'HH')<12 then 'morning' when format(timestamp,'HH')<17 then 'afternoon' else 'evening' end Time,count(orderid)order_cnt from orders group by DATENAME(dw,timestamp), case when format(timestamp,'HH')<12 then 'morning' when format(timestamp,'HH')<17 then 'afternoon' else 'evening' end order by count(orderid) desc

    • @datasculptor2895
      @datasculptor2895 12 днів тому

      Nice. Using CTE might give you performance issue. If you are able to achieve without using cte and sub queries then it is great 😊

    • @devendrabarasker4987
      @devendrabarasker4987 12 днів тому

      @@datasculptor2895 thank you so much for reply 🙌🙌

  • @sabesanj5509
    @sabesanj5509 12 днів тому

    Brother please mention the question in description section or in blog site.