Пікірлер
@aamir1710
@aamir1710 15 сағат бұрын
You are the best bro!
@yuvrajasus
@yuvrajasus Күн бұрын
bhayiya kamaal ho aap to. Dher sara dhanyawad
@yuvrajasus
@yuvrajasus Күн бұрын
kya bdhia samjhate ho yar, thankyou.
@8bitcoder731
@8bitcoder731 2 күн бұрын
can u comment on precision
@arghyadas2836
@arghyadas2836 3 күн бұрын
Can you please solve this using LAG and COALESCE as well??
@dhwnis
@dhwnis 4 күн бұрын
select contest_id, round((count(r.user_id)/(select count(distinct user_id) from Users) * 100),2) as percentage from Users u join Register r on u.user_id = r.user_id group by contest_id order by percentage desc, contest_id asc
@NitinKumar-wm2dg
@NitinKumar-wm2dg 5 күн бұрын
Sir, duplicates handle karne ke liye kya hua, usko alag se handle nahi karenge? aur mera code tha, usme ek testcase pass nahi hora, please help. - with UnitSold as ( select product_id as product_id,sum(unit) as unit from ( select distinct * from Orders where month(order_date)=2 and year(order_date)=2020 ) t group by product_id) select product_name,unit from products p inner join UnitSold u where p.product_id=u.product_id having unit>=100;
@rAhuly9
@rAhuly9 6 күн бұрын
Awesome content! I was searching for JavaScript LeetCode questions on KZbin and watched many videos, but no one explains with such depth and clarity. You clear all concepts in such detail. This man truly deserves more subscribers and likes. You're a genius-love your content!
@AmanKumar-hi3ux
@AmanKumar-hi3ux 6 күн бұрын
try the below: i too get confused sometimes with group by select product_id,year as first_year ,quantity, price from (select product_id,year, dense_rank() over (partition by product_id order by year asc) as rn ,quantity, price from sales) r where rn=1
@ashishpaul3394
@ashishpaul3394 6 күн бұрын
why can't we use WHERE in this query ?
@skkrrtt2344
@skkrrtt2344 7 күн бұрын
SELECT sell_date, COUNT(DISTINCT product) AS num_sold, GROUP_CONCAT( DISTINCT product ORDER BY product SEPARATOR ',' ) AS products FROM Activities GROUP BY sell_date ORDER BY sell_date; .we should "ORDER BY sell_date" only. That is also working fine.
@tenzinchoepheldev
@tenzinchoepheldev 7 күн бұрын
My code goes like. -------------------------- with cte as ( select person_name , sum(weight) over ( order by turn) as weight_sum from Queue order by turn desc ) select person_name from cte where weight_sum<=1000 limit 1
@hvsmp1768
@hvsmp1768 7 күн бұрын
bhai join q kiye dono same table ko?
@Domendra_KS
@Domendra_KS 7 күн бұрын
Why we use inner join ? Can we use another join instead of inner join ?
@Zenetz-le4mq
@Zenetz-le4mq 9 күн бұрын
hats off sir
@ashmipandey9226
@ashmipandey9226 9 күн бұрын
🎉great work 👍👍
@johnkeeven6889
@johnkeeven6889 10 күн бұрын
The query isn't working if we are using Having instead of Where, some test cases are failing. Select activity_date AS day, Count(DISTINCT user_id) active_users From Activity Group by activity_date Having activity_date Between '2019-06-27' AND '2019-07-28'
@San_kyu
@San_kyu 11 күн бұрын
Can we solve using left join?
@Engineeeer_1
@Engineeeer_1 12 күн бұрын
I got stuck on this problem and ended up wasting a week because I gave up on the series. Now, I’m seeking help.
@AakifKhan-h9e
@AakifKhan-h9e 16 күн бұрын
# Write your MySQL query statement below SELECT user_id , CONCAT(UPPER(SUBSTRING(name,1,1)),LOWER(SUBSTRING(name,2))) AS name FROM Users ORDER BY 1
@KaranBhosale-c4n
@KaranBhosale-c4n 16 күн бұрын
select max(salary) as SecondHighestSalary from Employee where salary < (select max(salary) from Employee)
@skkrrtt2344
@skkrrtt2344 17 күн бұрын
SELECT product_id,MIN(year) AS first_year,quantity ,price FROM Sales GROUP BY product_id; Sir why this query is not working
@nikhilpatil8013
@nikhilpatil8013 17 күн бұрын
Awesome
@kingswitch08
@kingswitch08 18 күн бұрын
not passing all test cases. please help SELECT ROUND(SUM(CASE WHEN order_date = customer_pref_delivery_date THEN 1 ELSE 0 END)*100/COUNT(customer_id),2) as immediate_percentage FROM Delivery WHERE order_date in ( SELECT MIN(order_date) FROM Delivery GROUP BY customer_id )
@AbhishekGupta-lg5fn
@AbhishekGupta-lg5fn 19 күн бұрын
select user_id, concat(upper(left(name,1)),lower(right(name,-2))) as name from users order by User_id can this be used if no why
@luckilygamer5462
@luckilygamer5462 20 күн бұрын
my solution: SELECT res.product_id, res.year AS first_year, res.quantity, res.price FROM ( SELECT *, RANK() OVER (PARTITION BY product_id ORDER BY year) AS rnk FROM sales ) res WHERE res.rnk = 1;
@surajshelke8720
@surajshelke8720 20 күн бұрын
select project_id, round(sum(e.experience_years)/count(*),2) as average_years from Project p JOIN Employee e On p.employee_id = e.employee_id group by p.project_id
@BhagatBhutale..
@BhagatBhutale.. 21 күн бұрын
🙏
@punyashloknath1990
@punyashloknath1990 24 күн бұрын
i think small mistake in your code, it should be greater than equal to 3 , beacause we need to find top 3 maximum salary so equal to condition should be there
@NitinKumar-wm2dg
@NitinKumar-wm2dg 7 күн бұрын
i guess he used distinct in the count(distinct e2.salary) distinct ensure different salaries grateer than the current vale.
@alirana9244
@alirana9244 25 күн бұрын
Ye easy category ma kaise aa sakta ha? Itna tatti question ha
@rachit.gulyani
@rachit.gulyani 27 күн бұрын
WITH CTE AS ( SELECT VISITED_ON,SUM(AMOUNT) AS AMOUNT FROM CUSTOMER GROUP BY VISITED_ON ) SELECT VISITED_ON, SUM(AMOUNT) OVER(ORDER BY VISITED_ON ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS AMOUNT, ROUND(AVG(AMOUNT*1.0) OVER (ORDER BY VISITED_ON ROWS BETWEEN 6 PRECEDING AND CURRENT ROW),2) AS AVERAGE_AMOUNT FROM CTE ORDER BY VISITED_ON OFFSET 6 ROWS;
@laxmansingh856
@laxmansingh856 28 күн бұрын
sir maine bhi same hi kra hai but when I'm submitting this solution, so, error occur "exceed time limit" what should I do ?
@mohdfahad9558
@mohdfahad9558 29 күн бұрын
Isko do- while loop se kiya jaye to kaisa rahega
@sachinbandil9245
@sachinbandil9245 29 күн бұрын
Left join kyu kiya sir kewal join se nhi hoga
@skkrrtt2344
@skkrrtt2344 Ай бұрын
SELECT query_name, ROUND(SUM(rating / position) / COUNT(rating), 2) AS quality, ROUND(SUM(CASE WHEN rating < 3 THEN 1 ELSE 0 END) * 100.0 / COUNT(rating), 2) AS poor_query_percentage FROM Queries GROUP BY query_name; This is my solution
@skkrrtt2344
@skkrrtt2344 Ай бұрын
# Write your MySQL query statement below SELECT r.contest_id, ROUND(COUNT(DISTINCT user_id)*100/(SELECT COUNT(user_id) from Users),2) as percentage FROM Users as u RIGHT JOIN Register as r USING(user_id) GROUP BY contest_id ORDER BY percentage DESC,r.contest_id; My solution
@AbhishekTiwari-bk4bt
@AbhishekTiwari-bk4bt Ай бұрын
SIR Can we use USING PRODUCT_ID INSTEAD OF ON P.PRODUCT_ID = U.PRODUCT_ID I TRIED USING THE FIRST SYNTAX but it shows syntax error
@VloggerBoyDeepak
@VloggerBoyDeepak Ай бұрын
sir you explained very well
@vedantkulkarni5860
@vedantkulkarni5860 Ай бұрын
crazzy
@TechKeeda0708
@TechKeeda0708 Ай бұрын
I wrote everything correctly but I didn't know that I had to put brackets on both queries bcz without the bracket it was showing that only one order by is possible....thank you for your solution sir....goty badge♥️
@TechKeeda0708
@TechKeeda0708 Ай бұрын
Crystal clear sir....thank you♥️
@rishavrajsingh7660
@rishavrajsingh7660 Ай бұрын
hello I'm having one question why you didn't use the join and how its even possible without join function?
@arebkhan6350
@arebkhan6350 Ай бұрын
hello sir I an unable to solve leet code problems not even easy problems in without? looking the youtube videos or solutions is that normal ?
@skkrrtt2344
@skkrrtt2344 Ай бұрын
SELECT p.product_id ,IFNULL(ROUND(SUM(p.price*u.units)/SUM(units),2),0.00) AS average_price FROM Prices as p LEFT JOIN UnitsSold as u ON p.product_id=u.product_id AND u.purchase_date BETWEEN p.start_date AND p.end_date GROUP BY product_id; This my solution.
@mohammedsuboorahmed6282
@mohammedsuboorahmed6282 Ай бұрын
With cte as (Select *, sum(weight) over (order by turn rows between unbounded preceding and current row) as total from queue) Select person_name from cte Where total <=1000 Order by total desc Limit 1;
@varshithrgowda1319
@varshithrgowda1319 Ай бұрын
we can also do this without using inner join (in oracle):- select name from Employee where id in (select managerId from Employee group by managerId having count(managerId)>=5);
@HariharanTamilarashanJeyasri
@HariharanTamilarashanJeyasri Ай бұрын
Bro if English better all people 😢
@NahushAgrawal
@NahushAgrawal Ай бұрын
This course is excellent, Chirag! While I had solved those queries before, watching your videos has provided me with new insights and a deeper understanding. Some problems I had tackled using window functions never made me consider alternative solutions. After watching, I’m discovering even better approaches!
@kartikeysingh1670
@kartikeysingh1670 Ай бұрын
thanks 👍👍👍👍
@abhijaychouhan5176
@abhijaychouhan5176 Ай бұрын
SELECT contest_id, ROUND(COUNT(contest_id)*100/(SELECT COUNT(user_id) FROM Users), 2) AS percentage FROM Register GROUP BY contest_id ORDER BY percentage DESC, contest_id This code is running fine , even if I changed this "distinct user_id" to "contest_id" and why this code is more optimised HELP ME