No video

Top 10 SQL interview Questions and Answers | Frequently asked SQL interview questions.

  Рет қаралды 228,617

Ankit Bansal

Ankit Bansal

Күн бұрын

In this video we will discuss most frequently asked top 10 SQL interview questions. If you have any interview I am sure 2-3 questions will be from this list.

Пікірлер: 302
@ankitbansal6
@ankitbansal6 Жыл бұрын
Master the art of with my zero to hero SQL course. The course is focused on data analytics and covers all the advanced concepts starting from scratch. www.namastesql.com/course-detail/think-sql-go-from-zero-to-hero-english Course contains 2 portfolio projects and a bonus session on Tableau. 100+ interview problems to crack any SQL INTERVIEW.
@avinashmishra4995
@avinashmishra4995 Жыл бұрын
Is it in udemy ?
@ankitbansal6
@ankitbansal6 Жыл бұрын
@@avinashmishra4995 nope
@Rohitraj-mv3pz
@Rohitraj-mv3pz 8 ай бұрын
​@@ankitbansal6 bro i really need your help.. is there any way i can reach out to you..
@bhartisingh3750
@bhartisingh3750 3 ай бұрын
Delete duplicate records query in not working in databricks notebook for deleting duplicate records from a table.. is there any way to do this in databricks notebook table?
@OBLIVIONSHREE
@OBLIVIONSHREE 2 ай бұрын
Bro you have taught everything for free in your channel only, why would I will but the course.
@mariecurie5245
@mariecurie5245 2 жыл бұрын
create table emp( emp_id int, emp_name varchar(20), department_id int, salary int, manager_id int, emp_age int); insert into emp values (1, 'Ankit', 100,10000, 4, 39; insert into emp values (2, 'Mohit', 100, 15000, 5, 48); insert into emp values (3, 'Vikas', 100, 10000,4,37); insert into emp values (4, 'Rohit', 100, 5000, 2, 16); insert into emp values (5, 'Mudit', 200, 12000, 6,55); insert into emp values (6, 'Agam', 200, 12000,2, 14); insert into emp values (7, 'Sanjay', 200, 9000, 2,13); insert into emp values (8, 'Ashish', 200,5000,2,12); insert into emp values (9, 'Mukesh',300,6000,6,51); insert into emp values (10, 'Rakesh',300,7000,6,50);
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thank you 😊
@satyanathparvatham4406
@satyanathparvatham4406 Жыл бұрын
thanks
@pranav9808
@pranav9808 Жыл бұрын
god bless you
@kartikpidurkar9590
@kartikpidurkar9590 Жыл бұрын
create table orders( customer_name char(10), order_date date, order_amount int, customer_gender char(6) ); insert into orders values('Shilpa','2020-01-01',10000,'Male'); insert into orders values('Rahul','2020-01-02',12000,'Female'); insert into orders values('Shilpa','2020-01-02',12000,'Male'); insert into orders values('Rohit','2020-01-03',15000,'Female'); insert into orders values('Shilpa','2020-01-03',14000,'Male');
@kartikpidurkar9590
@kartikpidurkar9590 Жыл бұрын
create table department( dept_id int, dept_name varchar(10) ); insert into department values(100,'Analytics'); insert into department values(300,'IT');
@Ghost-of-uchihaaa
@Ghost-of-uchihaaa 2 ай бұрын
This is my one-stop video before every interview for the past years. Brushes up my SQL skills like no other
@tupaiadhikari
@tupaiadhikari 2 жыл бұрын
For the First time in 10 years, I am feeling confident with using SQL, only after watching your series of videos. Earlier I used Python to do data preprocessing after doing Vanilla Select * from Table Statement, which was not a recommended approach for memory efficiency.
@ankitbansal6
@ankitbansal6 2 жыл бұрын
This is great. Best place to play with data is where it is residing 😊
@rajmathichithramani5864
@rajmathichithramani5864 4 күн бұрын
Really your videos are clear and helpfull for the person who dont understand sql Properly. likes me ...Now i love SQL Very much
@BeingSam7
@BeingSam7 2 сағат бұрын
I just discovered you, subscribed you and started watching your videos. I was asked a question in an interview which is similar to q 6 but a li'l twist in it. Q - get 2nd highest salary from each dept and if a dept does not have a second salary then first salary should appear in result.
@yashsoni2113
@yashsoni2113 2 жыл бұрын
DDL and Insert values for emp table. create table emp( emp_id int, emp_name varchar(20), department_id int, salary int, manager_id int, emp_age int); insert into emp values (1, 'Ankit', 100,10000, 4, 39), (2, 'Mohit', 100, 15000, 5, 48), (3, 'Vikas', 100, 10000,4,37), (4, 'Rohit', 100, 5000, 2, 16), (5, 'Mudit', 200, 12000, 6,55), (6, 'Agam', 200, 12000,2, 14), (7, 'Sanjay', 200, 9000, 2,13), (8, 'Ashish', 200,5000,2,12), (9, 'Mukesh',300,6000,6,51), (10, 'Rakesh',300,7000,6,50);
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thanks brother 😊
@yashsoni2113
@yashsoni2113 2 жыл бұрын
@@ankitbansal6 welcome ☺
@abhishek_grd
@abhishek_grd 2 жыл бұрын
Bang on ! Started product based companies interview prepration for Sr. DE role ( Google/Microsoft/Ubder/Amazon/Expedia / AirBnB) etc...and your content is crisp and clear. Thanks
@ankitbansal6
@ankitbansal6 2 жыл бұрын
🙏🙏
@addhyasumitra90
@addhyasumitra90 Ай бұрын
create table department( dept_id int, dept_name varchar(10) ); insert into department values(100,'Analytics'); insert into department values(300,'IT'); create table orders( customer_name char(10), order_date date, order_amount int, customer_gender char(6) ); insert into orders values('Shilpa','2020-01-01',10000,'Male'); insert into orders values('Rahul','2020-01-02',12000,'Female'); insert into orders values('Shilpa','2020-01-02',12000,'Male'); insert into orders values('Rohit','2020-01-03',15000,'Female'); insert into orders values('Shilpa','2020-01-03',14000,'Male');
@aasthamehtatech
@aasthamehtatech 2 жыл бұрын
Crisp & insightful
@sheikhshah2593
@sheikhshah2593 Жыл бұрын
Literally great. In all my SQL interviews one or the other is asked. Subscribed
@akp7-7
@akp7-7 2 жыл бұрын
Wow it wsd asked today delete duplicates..thanks for the videos.it is really really helpful
@user-bm9gy7ce3y
@user-bm9gy7ce3y Ай бұрын
I was asked 3 questions out of 5 from your list. Thanks alot
@shakthimaan007
@shakthimaan007 24 күн бұрын
Questions: Q1 - How to find duplicates in a given table Q2 -> How to delete duplicates Q3 -> difference berween union ana union all Q4 -> diffrence between rank.row number and dense rank Q5 -> employees who are not present in deparament table Q6 > second highest salary in each dep Q7 -> find all transaction done by Shilpa Q8 -> self join, manager salary > emp salary Q9 -> Joins Left join/äner join Q10 -› update query to swap gender
@chaithanyag1669
@chaithanyag1669 2 жыл бұрын
Your videos are very good and helpful. Thank you for providing data with create and insert statements.
@suketshah7697
@suketshah7697 2 жыл бұрын
very simple way to explain...Nice!
@suman3316
@suman3316 2 жыл бұрын
Very Useful...I hope part2 will come soon
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Yes it will
@pavitrashailaja850
@pavitrashailaja850 2 жыл бұрын
Thnks for the video. Very helpful 👍
@hairavyadav6579
@hairavyadav6579 9 күн бұрын
Hi Sir, Big thank to you i learn lot of things in sql after watching your video . I want to add to solution from my side please let me know this will fine or not? 1) with cte as ( select *,row_number() over(partition by emp_id order by time desc) as rnk from hospital) select count(*) from cte where rnk =1 and action ="in"; 2) select count(*) as total_person from hospital h where time =(Select max(time) from hospital h1 where h1.emp_id = h.emp_id) and action ="in"; Waiting for your response. Again big thank to you.
@AnshuKumar-lh4gr
@AnshuKumar-lh4gr 2 жыл бұрын
Good one .. !!
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Glad you liked it
@surabhijagadish5210
@surabhijagadish5210 6 ай бұрын
Awesome
@puneeth74
@puneeth74 2 жыл бұрын
Thanks for this video.
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Glad you liked it 😊
@rohitsehajpal9295
@rohitsehajpal9295 Жыл бұрын
Hi Ankit, first of all this is really a great initiative that you are sharing all this knowledge and explaining the complex queries in a very easy way. And because of this I am really glad to tell you that your channel has majorly helped me to crack one of the SQL interview. Thank you so much for such a great effort and we all wish to see some more complex queries and concepts in coming future, once again thank you so much. Wish you a great health!
@YG-jb2in
@YG-jb2in Жыл бұрын
Hey for which position you cleared the interview. And you cleared it as a fresher or experienced. Please reply.
@mdjahidulislamrazan4209
@mdjahidulislamrazan4209 Жыл бұрын
I solved it using self join: as we are performing row level aggregation, I guess this is a good case for that: SELECT DISTINCT(e1.emp_id), e2.val as salary, e3.val as bonus, e4.val as hike_percent FROM emp_compensation e1 JOIN emp_compensation e2 ON e1.emp_id = e2.emp_id AND e2.salary_component_type = 'salary' JOIN emp_compensation e3 ON e1.emp_id = e3.emp_id AND e3.salary_component_type = 'bonus' JOIN emp_compensation e4 ON e1.emp_id = e4.emp_id AND e4.salary_component_type = 'hike_percent'; Approach 2: with stats as ( SELECT emp_id, CASE WHEN salary_component_type = 'salary' THEN val END as salary, CASE WHEN salary_component_type = 'bonus' THEN val END as bonus, CASE WHEN salary_component_type = 'hike_percent' THEN val END as hike_percent FROM emp_compensation) SELECT emp_id, SUM(salary) as salary, SUM(bonus) as bonus, SUM(hike_percent) as hike_percent FROM stats GROUP BY emp_id
@mdjahidulislamrazan4209
@mdjahidulislamrazan4209 Жыл бұрын
Sorry I wanted to post in the section of this question: kzfaq.info/get/bejne/hZydd8eGrtzcaZ8.html
@rakeshgopidi4066
@rakeshgopidi4066 Жыл бұрын
@Md Jahidul Islam Razan - Approach 1 - 2.44 seconds vs Approach 2 - 1.31 seconds , i have tested in databricks community edition ,since underlying database is usually mysql, postgressql i think, CTE is more quicker to output both approaches are good !
@balajisundar9867
@balajisundar9867 Жыл бұрын
Good explanation👏 Please do more intermediate and advanced level of concepts in SQL.
@chiranjitdey3788
@chiranjitdey3788 Жыл бұрын
keep doing more videos like it. It really helped me in my job interview today. I am able to answer the question of how to remove duplicates from a table because of your videos.
@ankitbansal6
@ankitbansal6 Жыл бұрын
Great job!
@lokeshsharma2852
@lokeshsharma2852 2 жыл бұрын
Thanks sir for this amazing video
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Most welcome
@gracepaet4887
@gracepaet4887 2 жыл бұрын
Great video! Loved that last question. Subbed and eager to practice more SQL with your other videos
@ankitbansal6
@ankitbansal6 2 жыл бұрын
🙏🙏
@diptaganguly2346
@diptaganguly2346 2 жыл бұрын
Very Good explanation!
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Glad it was helpful!
@prakharsrivastava6571
@prakharsrivastava6571 2 жыл бұрын
revised today for deloiite interview and suscribed too
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Cool . all the best.
@manjumohan7731
@manjumohan7731 Жыл бұрын
#For swap gender : update orders set customer_gender=IF(customer_gender='Male','Female','Male');
@krishnabohidar7226
@krishnabohidar7226 10 ай бұрын
Amazing video, tomorrow I have an interview, I was clueless how to start and where to start, now I know what to do for tomorrow :)) Thanks for sharing :)
@ankitbansal6
@ankitbansal6 10 ай бұрын
Best of luck!
@krishnabohidar7226
@krishnabohidar7226 10 ай бұрын
Thank you sir :))
@raghum4938
@raghum4938 5 ай бұрын
simple and clear explanation!!
@suryanshsinghkarchuli9892
@suryanshsinghkarchuli9892 2 жыл бұрын
for better reach, keep creating content
@ankitbansal6
@ankitbansal6 2 жыл бұрын
sure.
@OmkarShinde-bz7oy
@OmkarShinde-bz7oy Жыл бұрын
yeah it was really important vid as see for the interveiw sceneriao
@poojasalunkhe7416
@poojasalunkhe7416 26 күн бұрын
Thank you
@user-mz5dn4el7j
@user-mz5dn4el7j 2 ай бұрын
Ankit sir added humour silently in this video with q10 😃
@prikshitbatta
@prikshitbatta Жыл бұрын
Really Master class videos Ankit, Thanks.
@yashdhas8202
@yashdhas8202 2 жыл бұрын
I am watching your one video each morning. So one day I will work as data engineer in good product based company.
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thats a great way of preparing yourself 😊🙏
@joeypencil5368
@joeypencil5368 Жыл бұрын
You just earned a subscribe from me bro. I haven't used SQL in years, but due to a career change I'm planning to have soon, I'll need to learn more about SQL in-depth alongside bettering my skillset in C++ programming.
@ankitbansal6
@ankitbansal6 Жыл бұрын
Cool. Thank you 😊
@gameply347
@gameply347 5 ай бұрын
I guess we can use subquery table as a normal table to display information using alias and where clause , but when it comes to comparison it needs to return only 1 value :) !!
@abdulwahab-rw1yq
@abdulwahab-rw1yq 2 жыл бұрын
Thanks Ankit its very helpful in interivews wish i had come across your videos early.. thnks much
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thank you 😊
@jenishkothari262
@jenishkothari262 Жыл бұрын
Leetcode Top 50 Interview Problems - SQL Playlist kzfaq.info/sun/PLsgq4reKtSzyEoZh2_Leks0CxfQb-zfPw
@dattatrayarathi1014
@dattatrayarathi1014 2 жыл бұрын
Thank for the video 🙏
@sandeeplakde7739
@sandeeplakde7739 2 жыл бұрын
Very well explained... 👌
@vlog.444
@vlog.444 Ай бұрын
Bro good vide class Bren you have to increase your sound
@gauravmdil
@gauravmdil Жыл бұрын
Thanks ankit, ur videos always encourage and boost confidence to prac more n go beyond our limit. Thanks Man
@ankitbansal6
@ankitbansal6 Жыл бұрын
Keep it up
@ime227
@ime227 Жыл бұрын
Great content. Thank you Ankit
@ankitbansal6
@ankitbansal6 Жыл бұрын
Thanks a ton
@gourabnandy826
@gourabnandy826 2 жыл бұрын
Hi Ankit, loved your all videos. Looking forward to see a video on subqueries,
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Sure 🙂
@adityabaha
@adityabaha 2 жыл бұрын
Yes, you are absolutely right, Many questions are based on your teaching. Thanks again for this great help Ankit!!
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Good to know 😊
@meghasyam427
@meghasyam427 Жыл бұрын
Beautiful presentation
@ankitbansal6
@ankitbansal6 Жыл бұрын
Thank you! Cheers!
@sasidharreddy5008
@sasidharreddy5008 3 ай бұрын
you don't need the motivation from others because, you yourself is a motivation 🤗
@ankitbansal6
@ankitbansal6 3 ай бұрын
🙏
@k.hariharasudan9335
@k.hariharasudan9335 5 ай бұрын
Q7. MSSQL does not depend on case-sensitive but in the Oracle is depend on the case-sensitive
@vigneshnagaraj7137
@vigneshnagaraj7137 2 жыл бұрын
It will be helpful if you can create videos on views and stored procedures
@LogicQuest
@LogicQuest 2 жыл бұрын
thanks Ankit..good tutorial..
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thank you 😊
@muruganselva7431
@muruganselva7431 2 ай бұрын
with CTE as ( select * ,row_number() over(partition by emp_id order by emp_id) as rnk from emp order by emp_id asc ) delete from CTE where rnk > 1 From CTE we can't delete records?
@nitinnagpalofficial
@nitinnagpalofficial 2 жыл бұрын
Ankit, I love your educational content. Is it possible for you to record the whole PL/SQL course for beginner/Intermediates?
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thank you. I will plan in future 🙂
@NitishKumar-xr9tx
@NitishKumar-xr9tx 5 ай бұрын
In 2nd Question of removing duplicates: We are deleting values from the CTE table which is a TEMP table. Then how it is deleting values from the MAIN table?
@souravsinha5330
@souravsinha5330 Жыл бұрын
Thanks a lot, Learned lots of new concepts.
@ankitbansal6
@ankitbansal6 Жыл бұрын
Glad to hear that!
@agirmaus-lh9zi
@agirmaus-lh9zi Жыл бұрын
very helpful ..thanks
@ankitbansal6
@ankitbansal6 Жыл бұрын
Glad it was helpful!
@ririraman7
@ririraman7 2 жыл бұрын
Thank you so much. Make vidoes on JOINS.
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Sure
@MubarakAli-qs9qq
@MubarakAli-qs9qq 2 күн бұрын
Big fan sir❤
@lykavalladolid688
@lykavalladolid688 Жыл бұрын
thanks, it actually let me through so i could download it.
@aadarshchoudhary9648
@aadarshchoudhary9648 Жыл бұрын
Thanks
@perumalbalachandranjj2358
@perumalbalachandranjj2358 Жыл бұрын
Thanks for this Video. I have one doubt, Question number 2. How to delete duplicates from a table? Shall we do it in mysql? I tried but I didn't get correct result.
@manjumohan7731
@manjumohan7731 Жыл бұрын
+1
@siddharthchoudhary103
@siddharthchoudhary103 Ай бұрын
5th question can we also done used left anti right? like where dep.deptid is null?
@varunl6948
@varunl6948 8 ай бұрын
Thanks for this!
@shashankemani1609
@shashankemani1609 Жыл бұрын
Very helpful sir, thank you!
@ankitbansal6
@ankitbansal6 Жыл бұрын
You are welcome!
@happyheart9431
@happyheart9431 9 ай бұрын
Million thanks
@pritamshende8434
@pritamshende8434 Жыл бұрын
Just loving your content.. Very well explained.
@ankitbansal6
@ankitbansal6 Жыл бұрын
Happy to hear that!
@fog2640
@fog2640 9 ай бұрын
finished watching
@One_Of_Kind_Jilu
@One_Of_Kind_Jilu 2 жыл бұрын
Just landed here bro you are doing amazing job
@subhankarjadab7617
@subhankarjadab7617 Жыл бұрын
Superb video..liked every second of the video 💖
@ankitbansal6
@ankitbansal6 Жыл бұрын
Thank you! Cheers!
@prajjwaljaiswal3419
@prajjwaljaiswal3419 2 жыл бұрын
You are doing really awesome. Please keep doing this. One suggestion: Please don't forget to add create table script.
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thank you. Scripts are there in most of the video description box. Might have missed few in my initial videos. Will put them soon.
@prajjwaljaiswal3419
@prajjwaljaiswal3419 2 жыл бұрын
@@ankitbansal6 Cool
@uttamthakur2016
@uttamthakur2016 10 ай бұрын
I have subscribed and liked . you are doing wonderful job
@ankitbansal6
@ankitbansal6 10 ай бұрын
Thank you so much 😀
@nammibhargav9498
@nammibhargav9498 2 жыл бұрын
Ankit bhai if you have time can you solve some hacker rank test questions for better understanding for people who are learning sql newly..that would be helpfull
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Do you have some links to the good problems?
@TrustinData
@TrustinData 2 жыл бұрын
Tqsm for awesome explanation 🔥
@shuvo9131
@shuvo9131 2 жыл бұрын
Thanks brother, nice explanation
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thank you
@aashishmalhotra
@aashishmalhotra 2 жыл бұрын
Wow such a nice content. Please zoom a bit while making videos. Because most audience watch it over phone it strain the eyes
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Sure
@shivangnirawat9536
@shivangnirawat9536 2 ай бұрын
In the 2 question, delete from cte is written so how the records got deleted from original table
@SubhamDas-tb3xf
@SubhamDas-tb3xf 2 ай бұрын
Hey Ankit! I was thinking about that delete duplicate question. U r deleting the duplicate data from cte which is a temporary result set , right? It is working fine but how it's deleting from original table? MySQL doesn't support this from 8+ versions I guess..we have to use that cte query like a subquery in mysql. But in ssis it is working. Even in leetcode ! But I think it is always better to reference the original table rather than querying from cte i.e a temporary result set. Selection is fine with cte but dml operation! Let me know about your thoughts, I would love to hear!
@mohammedshabaaz9625
@mohammedshabaaz9625 Жыл бұрын
please make a part 2 of this video Ankit. thank you for your efforts
@ankitbansal6
@ankitbansal6 Жыл бұрын
Sure I will
@irinasummey4156
@irinasummey4156 2 жыл бұрын
Great video, I took down some notes!
@dhrubajyotichatterjee1883
@dhrubajyotichatterjee1883 2 жыл бұрын
hi Ankit , can you please make some videos for product based companies. Thank yoou for your effort. Appriciatable
@ankitbansal6
@ankitbansal6 2 жыл бұрын
I have a lot of them. Check out complex SQL playlist
@muhammedar3071
@muhammedar3071 2 жыл бұрын
1m likes 👍
@dhirajsharma1199
@dhirajsharma1199 2 жыл бұрын
Wonderful crisp and short explanation Ankit. I have my interviews lined up can you share resources for SQL interview questions, Data Modelling and Normalization scenario based questions? I know all basics and all theories but I want to practice on questions which have answers as well.
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thanks Dhiraj. You can practice more from leetcode.
@harini2933
@harini2933 Жыл бұрын
Hey Ankit, I'm running below query for deleting duplicates -Q2 : WITH cte as (SELECT * , row_number() OVER( PARTITION BY emp_id ORDER BY emp_id ) AS rn FROM emp) DELETE FROM cte WHERE rn>1 but, I'm getting error : "Error Code: 1288. The target table cte of the DELETE is not updatable" . Kindly reply. TIA 😇
@CoolGuy
@CoolGuy Жыл бұрын
Try delete * . Which rdbms are you using?
@yatinshekhar787
@yatinshekhar787 Жыл бұрын
hi , did you got the solution for the above query coz i am facing the same issue
@harini2933
@harini2933 Жыл бұрын
@@yatinshekhar787 no I couldn't
@masoodahmed6600
@masoodahmed6600 Жыл бұрын
before delete alias a will be give
@Nagaj719
@Nagaj719 Жыл бұрын
with cte as ( select * ,row_number() over(partition by emp_id order by emp_id) as RN from emp) delete from cte where RN > 1
@dineshpanda5804
@dineshpanda5804 2 жыл бұрын
Love your valuable contents. I have few question sets from facing different screening. Can I share with you for help with solutions? Your way of explanation helps a lot
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Sure send me on ankitbansal1988@gmail.com
@itsme1674
@itsme1674 2 жыл бұрын
Thanks 👍
@amangupta1959
@amangupta1959 2 жыл бұрын
Hi Ankit, the only doubt I have is while deleting duplicate records, we deleted from CTE and not actual employee table, how records were deleted from emp table?
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Hi Aman , glad you asked this question. Since the CTE is referring to the table directly, it was possible. This might not be possible in all the databases but works in SQL server.
@amangupta1959
@amangupta1959 2 жыл бұрын
@@ankitbansal6 Right. I tried and even the below query is not working in MySQL. DELETE FROM (select *, row_number() over(partition by empno) as rn from emp) where rn>1;
@DataRevolution10
@DataRevolution10 2 жыл бұрын
@@ankitbansal6 Hi Ankit, I am also facing same issue. I assume CTE will delete from parent table. it fails with "The target table CTE of the DELETE is not updatable "
@ankitbansal6
@ankitbansal6 2 жыл бұрын
@@DataRevolution10 it works only in SQL server
@manjumohan7731
@manjumohan7731 Жыл бұрын
+1
@I_am_AmanSingh
@I_am_AmanSingh Жыл бұрын
You just earned a subscriber really great content🥺
@yatinshekhar787
@yatinshekhar787 Жыл бұрын
5/123 Stuck with 2 ques , coz i'm using mysql
@gouthamstar6558
@gouthamstar6558 4 ай бұрын
I asked a question a employee enters and leaves office and he swipes in and swipes out in multiple instances, so I want to find the total office hours he spent in the office( he may come at 10 PM and take a break at 12:30 AM in that case it shows that he is spending 2 hours in that day but that's not true right), so now I have to calculate total time he spent employee id, Office_swipe_record given
@mrs.vyshnavinitin9023
@mrs.vyshnavinitin9023 2 жыл бұрын
For question 7: SELECT * FROM orders WHERE customer_name LIKE ‘Shilpa’. In this case it will fetch only 1 record Shilpa. As you said, if we apply where UPPER(customer_name) LIKE ‘SHILPA’ then it will fetch all the 3 records. Correct me if I am wrong.
@jagatSingh-ht1cd
@jagatSingh-ht1cd Жыл бұрын
Yes you are correct i was thinking the same.
@harini2933
@harini2933 Жыл бұрын
select orders.* from orders where customer_name like 'shilpa'; -- try this query, it fetches all records with shilpa and Shilpa
@kunalgaurav3301
@kunalgaurav3301 Жыл бұрын
Hi, Ankit. you made them look so easy. Thank you💌. it would be great if you could provide the code of the creation of tables so i can practice it on my workbench.
@ankitbansal6
@ankitbansal6 Жыл бұрын
It's there in the comments section
@ritikajaiswal3824
@ritikajaiswal3824 2 жыл бұрын
can you make a video on stored procedures.. from basic to everything needed to know
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Sure will plan.
@bhartisingh3750
@bhartisingh3750 3 ай бұрын
Delete duplicate records query in not working in databricks notebook for deleting duplicate records from a table.. is there any way to do this in databricks notebook table? @ankit
@namanverma6509
@namanverma6509 2 жыл бұрын
Please make a playlist for sql for the beginners which includes everything like joins, Subquery, functions which used in ms sql..
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Sure. I have that in plan.
@avinashmishra4995
@avinashmishra4995 Жыл бұрын
@Ankit Bansal bhai if we have left whats the use of right join ?
@ankitbansal6
@ankitbansal6 Жыл бұрын
Not required 😁
@jayrajkakde2813
@jayrajkakde2813 2 жыл бұрын
Diff between count* and count1
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thanks for adding 😊
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Wian
Рет қаралды 5 МЛН
Unveiling my winning secret to defeating Maxim!😎| Free Fire Official
00:14
Garena Free Fire Global
Рет қаралды 10 МЛН
What will he say ? 😱 #smarthome #cleaning #homecleaning #gadgets
01:00
All About SQL Aggregations | SQL Advance | Zero to Hero
17:43
Ankit Bansal
Рет қаралды 52 М.
Practice SQL Interview Query | Big 4 Interview Question
14:47
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Wian
Рет қаралды 5 МЛН