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

  Рет қаралды 240,543

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.

Пікірлер: 310
@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 9 ай бұрын
​@@ankitbansal6 bro i really need your help.. is there any way i can reach out to you..
@bhartisingh3750
@bhartisingh3750 4 ай бұрын
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 3 ай бұрын
Bro you have taught everything for free in your channel only, why would I will but the course.
@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 жыл бұрын
🙏🙏
@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 2 жыл бұрын
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');
@Ian15278
@Ian15278 28 күн бұрын
with dup as ( select ROW_NUMBER() over(partition by emp_id order by emp_id desc) as Find_duplicate from emp) delete from emp where emp_id in ( select * from dup where Find_duplicate > 1);
@saurabhtekale5084
@saurabhtekale5084 Жыл бұрын
Performance wise why joins are better than subqurey??
@manjumohan7731
@manjumohan7731 Жыл бұрын
#For swap gender : update orders set customer_gender=IF(customer_gender='Male','Female','Male');
@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 ☺
@addhyasumitra90
@addhyasumitra90 2 ай бұрын
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');
@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 Ай бұрын
Really your videos are clear and helpfull for the person who dont understand sql Properly. likes me ...Now i love SQL Very much
@manishgnagpure
@manishgnagpure 5 күн бұрын
Hi Ankit ji, I seen some of the videos and those are very interesting, and useful. I request you to create a video on SQL Index in details with examples. 1. Before creating index how the data loding in page level. And after creating index what kind of table ( page level) structure will be. 2. What will be structure while create only cluster and only noncluster and both. Mean every one can understand beginners to exp students. Waiting for your new video.
@SubhamDas-tb3xf
@SubhamDas-tb3xf 3 ай бұрын
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!
@ammarfasih3866
@ammarfasih3866 12 күн бұрын
In the first question where we wanna find out the duplicates, we knew that the duplicates would be as per emp_id. How about if we wanna check if the entire row is unique or not rather than checking any particular column?
@bhartisingh3750
@bhartisingh3750 4 ай бұрын
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
@Ghost-of-uchihaaa
@Ghost-of-uchihaaa 3 ай бұрын
This is my one-stop video before every interview for the past years. Brushes up my SQL skills like no other
@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
@siddharthchoudhary103
@siddharthchoudhary103 3 ай бұрын
5th question can we also done used left anti right? like where dep.deptid is null?
@shivangnirawat9536
@shivangnirawat9536 4 ай бұрын
In the 2 question, delete from cte is written so how the records got deleted from original table
@kunalmjain
@kunalmjain 5 ай бұрын
For me it is showing target table cte of the delete is not updatable
@SK-wp4tm
@SK-wp4tm 12 күн бұрын
Please provide dataset for practice 🙏
@vlog.444
@vlog.444 2 ай бұрын
Bro good vide class Bren you have to increase your sound
@moumitadebbarma8505
@moumitadebbarma8505 6 күн бұрын
how can I get the dataset to practice this?
@NitishKumar-xr9tx
@NitishKumar-xr9tx 6 ай бұрын
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?
@DEwithDhairy
@DEwithDhairy 8 ай бұрын
PySpark Step by step solution of duplicate finding problem: kzbin.info/www/bejne/kJiTiWx3q5WFZ6csi=PfOt0c_pN99bNgqA
@kavyareddykonakati9657
@kavyareddykonakati9657 3 ай бұрын
Hi Ankit, what if I have same rows with all same values in 2 rows, how can I do that.? As the code you explained is not working in MySQL workbench. Thanks!
@SubhamDas-tb3xf
@SubhamDas-tb3xf 3 ай бұрын
1. We might need the primary key in the original table. Without that how can you tell database which record to delete, if you can anyhow tell database 😂 that delete the records which I mentioned it will be exactly same as duplicates so everything will be deleted. First u need to assign primary key. 2. MySQL 8+ versions doesn't support deleting data from cte( it's a temporary result set so logically it should not change the original table. Not sure about ssis implementation. ) so u have to reference the original table after selecting duplicate records u gotta tell database to delete those using a subquery. Do this: With cte as (Select * , row_number() over(partion by all the columns names) as rn From Ur_table_name) Delete from ur_table_name where id in (select * from cte where rn > 1)
@perumalbalachandranjj2358
@perumalbalachandranjj2358 2 жыл бұрын
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
@sheikhshah2593
@sheikhshah2593 Жыл бұрын
Literally great. In all my SQL interviews one or the other is asked. Subscribed
@yashsoni2113
@yashsoni2113 2 жыл бұрын
Delete duplicates query is not working in MySQL why so? is there any other query for MySQL to delete duplicates?
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Yes that works only in SQL server.
@tradingtexi
@tradingtexi Жыл бұрын
For q1, what does “1” mean in count(1)?
@swarooppabbineedi1820
@swarooppabbineedi1820 Жыл бұрын
Do you got what it is about..?
@suman3316
@suman3316 2 жыл бұрын
Very Useful...I hope part2 will come soon
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Yes it will
@akp7-7
@akp7-7 2 жыл бұрын
Wow it wsd asked today delete duplicates..thanks for the videos.it is really really helpful
@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
@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?
@ashuvermashorts7167
@ashuvermashorts7167 2 ай бұрын
the sql course amount is showing 2499/ do you have any link for your all the courses and if i join your courses then what will the total amount
@ankitbansal6
@ankitbansal6 2 ай бұрын
www.namastesql.com/buy-now/sql-python-tableau-zero-to-hero-self-paced
@SuperMohit95
@SuperMohit95 2 жыл бұрын
When we do where rn = 2 we don't take into account the department that only has one employee for e.g in this video there is dep_id 900 that has only one employee.
@ankitbansal6
@ankitbansal6 2 жыл бұрын
In that case there is no second highest 🙂
@jenishkothari262
@jenishkothari262 Жыл бұрын
Leetcode Top 50 Interview Problems - SQL Playlist kzbin.info/aero/PLsgq4reKtSzyEoZh2_Leks0CxfQb-zfPw
@sushritsaha5287
@sushritsaha5287 14 күн бұрын
CREATE TABLE order_table ( customer_name VARCHAR(255), order_date DATE, order_amount INT, customer_gender VARCHAR(10) ); INSERT INTO order_table (customer_name, order_date, order_amount, customer_gender) VALUES ('Shilpa', '2020-01-01', 10000, 'Male'), ('Rahul', '2020-01-02', 12000, 'Female'), ('SHILPA', '2020-01-02', 12000, 'Male'), ('Rohit', '2020-01-03', 15000, 'Female'), ('shilpa', '2020-01-03', 14000, 'Male');
@muruganselva7431
@muruganselva7431 3 ай бұрын
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?
@shakthimaan007
@shakthimaan007 Ай бұрын
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
@avinashmishra4995
@avinashmishra4995 Жыл бұрын
@Ankit Bansal bhai if we have left whats the use of right join ?
@ankitbansal6
@ankitbansal6 Жыл бұрын
Not required 😁
@SN-mp7hc
@SN-mp7hc 3 ай бұрын
Hi Ankit , when to use count(1) and when to use count(*) can you explain?
@ankitbansal6
@ankitbansal6 3 ай бұрын
Both are the same. Use anyone.
@hairavyadav6579
@hairavyadav6579 Ай бұрын
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.
@commentator2407
@commentator2407 2 жыл бұрын
query 2 : delete duplicates im getting this errror The target table cte of the DELETE is not updatable
@ankitbansal6
@ankitbansal6 2 жыл бұрын
This works only in SQL server.
@commentator2407
@commentator2407 Жыл бұрын
@@ankitbansal6 is there an alternative for mysql?
@gauravghosh8002
@gauravghosh8002 25 күн бұрын
Sir by looking at this video it seems SQL is very easy but actually it's not so easy sir, in interview same questions I faced nervous and end up giving wrong query.
@High_jacked_by_Hormones
@High_jacked_by_Hormones 2 жыл бұрын
In the 7th question you have taken only first name , if there is a surname or middle name would be there , can we also proceed with the same rule?
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Yes same will work.
@DebolinaBanerjee-mz3bt
@DebolinaBanerjee-mz3bt Ай бұрын
@ankitbansal6 Hello Ankit, I need a small help ..Getting this error while running the query. Error Code: 1288. The target table cte of the DELETE is not updatable
@ankitbansal6
@ankitbansal6 Ай бұрын
It works only in sql server
@abhishek_grd
@abhishek_grd 2 жыл бұрын
Hello Ankit, I have onre request along with the explanation if you can share the create table command as well , will be helpful to dummy it to my own schema. Like here employee table
@ankitbansal6
@ankitbansal6 2 жыл бұрын
I have create and insert in most of the problems description. I will make sure I don't miss in future. Thanks for pointing out 😊
@suketshah7697
@suketshah7697 2 жыл бұрын
very simple way to explain...Nice!
@BeingSam7
@BeingSam7 Ай бұрын
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.
@gouthamstar6558
@gouthamstar6558 5 ай бұрын
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
@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
@ririraman7
@ririraman7 2 жыл бұрын
Thank you so much. Make vidoes on JOINS.
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Sure
@muhammedar3071
@muhammedar3071 2 жыл бұрын
1m likes 👍
@KaushikChowdri
@KaushikChowdri Жыл бұрын
Your approach to Delete duplicate valuse from the table is not working in my sql (gettting this pop up "The target table cte1 of the DELETE is not updatable")
@fired_developer
@fired_developer Жыл бұрын
Sir please raise the editor font more than 130% while recording , coz it's very hard to watch on the phone
@mmohammedsadiq2483
@mmohammedsadiq2483 9 ай бұрын
Where can i get dataset ,
@KapilKumar-hk9xk
@KapilKumar-hk9xk 4 ай бұрын
but CTE doesn't support delete operations right...I tried it but got below error "The target table cte of the DELETE is not updatable" with cte as (select *, row_number() over (partition by md5(concat_ws(",",emp_id,emp_name,emp_age))) as dup_row_id from employee) delete from cte where dup_row_id>1;
@ankitbansal6
@ankitbansal6 4 ай бұрын
It works only in SQL server
@KapilKumar-hk9xk
@KapilKumar-hk9xk 4 ай бұрын
@@ankitbansal6 ok. thanks for replying 😊
@garimabatra2658
@garimabatra2658 4 ай бұрын
@@ankitbansal6 What should be the approach for MYSQL?. Thanks in advance
@adilbsh
@adilbsh 2 жыл бұрын
First time I am seeing delete on cte , I thought we can only do select on cte
@ankitbansal6
@ankitbansal6 2 жыл бұрын
It works only in SQL server
@suryanshsinghkarchuli9892
@suryanshsinghkarchuli9892 2 жыл бұрын
for better reach, keep creating content
@ankitbansal6
@ankitbansal6 2 жыл бұрын
sure.
@pavitrashailaja850
@pavitrashailaja850 2 жыл бұрын
Thnks for the video. Very helpful 👍
@gameply347
@gameply347 6 ай бұрын
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 :) !!
@saurav_gupta_1998
@saurav_gupta_1998 Жыл бұрын
make the join question's video please
@ankitbansal6
@ankitbansal6 Жыл бұрын
Here you go kzbin.info/www/bejne/roObaJaqhMyjd6c
@mdjahidulislamrazan4209
@mdjahidulislamrazan4209 2 жыл бұрын
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 2 жыл бұрын
Sorry I wanted to post in the section of this question: kzbin.info/www/bejne/hWfQdZeLfturb80
@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 !
@ritikajaiswal3824
@ritikajaiswal3824 2 жыл бұрын
can you make a video on stored procedures.. from basic to everything needed to know
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Sure will plan.
@yatinshekhar787
@yatinshekhar787 Жыл бұрын
5/123 Stuck with 2 ques , coz i'm using mysql
@k.hariharasudan9335
@k.hariharasudan9335 7 ай бұрын
Q7. MSSQL does not depend on case-sensitive but in the Oracle is depend on the case-sensitive
@shrishti8332
@shrishti8332 2 жыл бұрын
Hi Ankit, what is diff btwn count(*), count (1) and count(0) ? please clear this concept.
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Sure
@user-jc6te1vm8v
@user-jc6te1vm8v Жыл бұрын
absolutely no difference at all even performance wise ... all will be counting rows including NULL values ... however COUNT(COL_NAME) will act differently by counting all rows excluding NULL's ...
@uttamx2016
@uttamx2016 11 ай бұрын
@@user-jc6te1vm8v you are right , I checked SELECT count([AddressLine2] ) FROM [AdventureWorks2017].[Person].[Address] -- 362 SELECT count([AddressLine2] ) FROM [AdventureWorks2017].[Person].[Address] -- 362 WHERE AddressLine2 IS NOT NULL SELECT [AddressLine2] FROM [AdventureWorks2017].[Person].[Address] -- 19,252 where [AddressLine2] is null
@NaveenKumar-fq4sb
@NaveenKumar-fq4sb Жыл бұрын
Sir in gender swap operation NULL is coming entire column where is error???
@KK-qc2qs
@KK-qc2qs 10 ай бұрын
these will be asked to freshers during interview?
@ankitbansal6
@ankitbansal6 10 ай бұрын
Some of them
@AnandaKrishna-t3h
@AnandaKrishna-t3h 3 ай бұрын
Ankit sir added humour silently in this video with q10 😃
@AhmadUmais
@AhmadUmais 2 ай бұрын
I was asked 3 questions out of 5 from your list. Thanks alot
@abb_raj1107
@abb_raj1107 2 жыл бұрын
what if i wanna to swap from row 4 and 5 value , I think 'case' only do for the first occurrences of match value.Thus why, only the first two rows are evaluated with case clause and rest remain the same. Is it true bhai? I am not clear about it. Plz shed some light .
@gourabnandy826
@gourabnandy826 2 жыл бұрын
Hi Ankit, loved your all videos. Looking forward to see a video on subqueries,
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Sure 🙂
@prakharsrivastava6571
@prakharsrivastava6571 2 жыл бұрын
revised today for deloiite interview and suscribed too
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Cool . all the best.
@mukuldhote03
@mukuldhote03 5 ай бұрын
Sir in Q2. it is showing error : 'Target table CTE of the DELETE is not updatable '
@ankitbansal6
@ankitbansal6 5 ай бұрын
That works in SQL server only
@mukuldhote03
@mukuldhote03 5 ай бұрын
@@ankitbansal6 thankyou for replying. If asked in an interview which query should I answer. This one or some other which works in MySql as I use MySql mostly?
@ankitbansal6
@ankitbansal6 5 ай бұрын
@@mukuldhote03 check this out : kzbin.info/www/bejne/aXPLoYR4rKejatUsi=JI6rwhsHXpkqmtjj
@chaithanyag1669
@chaithanyag1669 2 жыл бұрын
Your videos are very good and helpful. Thank you for providing data with create and insert statements.
@zamm-3527
@zamm-3527 Жыл бұрын
Hi @ankitbansal6 if possible can you provide any code for your package course really want to learn but due to inefficient fund can't. Please provide any code if possible
@ankitbansal6
@ankitbansal6 Жыл бұрын
Send me an email on sql.namaste@gmail.com
@balajisundar9867
@balajisundar9867 Жыл бұрын
Good explanation👏 Please do more intermediate and advanced level of concepts in SQL.
@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 🙂
@aasthamehtatech
@aasthamehtatech 2 жыл бұрын
Crisp & insightful
@dondapatinaveenkumar2920
@dondapatinaveenkumar2920 Жыл бұрын
Can you please tell me how to delete duplicates in mysql?
@vishalsonawane.8905
@vishalsonawane.8905 5 ай бұрын
Done
@lokeshsharma2852
@lokeshsharma2852 2 жыл бұрын
Thanks sir for this amazing video
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Most welcome
@gobinathv2506
@gobinathv2506 2 жыл бұрын
I am not a expert in SQL, I have a doubt regarding the last question (swapping gender) what else if we use IF condition in that query.
@ankitbansal6
@ankitbansal6 2 жыл бұрын
If condition not available in SQL. Only pl SQL
@gobinathv2506
@gobinathv2506 2 жыл бұрын
@@ankitbansal6 update set gender = if(gender = "M" ,"F", "M") whether it work?
@ankitbansal6
@ankitbansal6 2 жыл бұрын
@@gobinathv2506 No if keyword not present in plain SQL
@gobinathv2506
@gobinathv2506 2 жыл бұрын
@@ankitbansal6 ok but it working in MySQL. If we have both case and IF statement which one performs efficiently.
@ankitbansal6
@ankitbansal6 2 жыл бұрын
@@gobinathv2506 case
@jayrajkakde2813
@jayrajkakde2813 2 жыл бұрын
Diff between count* and count1
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thanks for adding 😊
@Ks-yi8ky
@Ks-yi8ky 8 ай бұрын
Sir pls make latest interview sql quetions
@kishorekumarrock2475
@kishorekumarrock2475 Жыл бұрын
Hlo sir is oracle sql is outdated
@ankitbansal6
@ankitbansal6 Жыл бұрын
No
@shubhiverma2571
@shubhiverma2571 2 жыл бұрын
please give data of emp table
@ankitbansal6
@ankitbansal6 2 жыл бұрын
I have pinned the comment with script
@karthikrful
@karthikrful 2 жыл бұрын
Hello Ankit Sir, I am getting this error while trying to delete the duplicate record (The with cte query) "Error Code: 1288. The target table cte of the DELETE is not updatable". Is it because I am using MySQL?
@manjumohan7731
@manjumohan7731 Жыл бұрын
+1
@jaitiwari241
@jaitiwari241 Жыл бұрын
Sir how I practice..this without dataset
@RiyaAggarwal-f2e
@RiyaAggarwal-f2e Жыл бұрын
Hi, I've got a query here. In the 2nd question, we are deleting the duplicate values from cte, how is it getting reflected in emp1 table?
@mohakjain1404
@mohakjain1404 Жыл бұрын
+1 to the question. Also @AnkitBansal, why did we go ahead and use Partiton concept to find and delete duplicate and why couldnt we have used the first logic of count(1) and use it in where clause and delete the entries cause thats what we actually did with rownumber as well. isn't it?
@lykavalladolid688
@lykavalladolid688 Жыл бұрын
thanks, it actually let me through so i could download it.
@aadarshchoudhary9648
@aadarshchoudhary9648 Жыл бұрын
Thanks
@RK-wf7re
@RK-wf7re 10 ай бұрын
Good content, i have a question why table name used as emp1, it should be emp right?
@ankitbansal6
@ankitbansal6 10 ай бұрын
Simply
@sumanacharya461
@sumanacharya461 Жыл бұрын
What is the difference between union and union distinct
@shwetadubey8880
@shwetadubey8880 Жыл бұрын
Just wanted to know can we use left anti join for the 5th question?
@priyav3249
@priyav3249 9 ай бұрын
Helpful video, Thanks. could you please share the dataset used in the video, to practice please.
@ankitbansal6
@ankitbansal6 9 ай бұрын
It's there in the comments section
@rudrakasha-t1v
@rudrakasha-t1v 8 ай бұрын
in question number 2 you took select two times ...can you please explain that .
@gauraavthakurr
@gauraavthakurr 4 ай бұрын
Second select was just to review table data, it's not past of code
@aashishmalhotra
@aashishmalhotra Жыл бұрын
Deleting using CTE is not working in sql 8+. any other way around to delete using cte
@ankitbansal6
@ankitbansal6 Жыл бұрын
It works only in SQL server
@sasidharreddy5008
@sasidharreddy5008 4 ай бұрын
you don't need the motivation from others because, you yourself is a motivation 🤗
@ankitbansal6
@ankitbansal6 4 ай бұрын
🙏
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 45 МЛН
小丑妹妹插队被妈妈教训!#小丑#路飞#家庭#搞笑
00:12
家庭搞笑日记
Рет қаралды 38 МЛН
Spongebob ate Patrick 😱 #meme #spongebob #gmod
00:15
Mr. LoLo
Рет қаралды 18 МЛН
All About SQL Aggregations | SQL Advance | Zero to Hero
17:43
Ankit Bansal
Рет қаралды 55 М.
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 45 МЛН