How and why a sql inner left right full and cross join returns the same row count

Поділитися
Вставка
  • Опубліковано 23 жов 2020
  • All SQL join types produce same result - Why and How ?
    All the SQL queries used in the demo are on our blog at the following link.
    csharp-video-tutorials.blogsp...
    Joins in SQL Server Video
    • Joins in sql server - ...
    Let's gift education together
    / kudvenkat
    How to become a full stack web developer
    • How to become a full s...
  • Наука та технологія

КОМЕНТАРІ • 52

  • @bezaar7762
    @bezaar7762 3 роки тому +10

    What can I say about this guy ?? There is no even words to explain how you helped me you saved my life . Your explanation 100000% . No words for you just May God bless and give you what ever you wishes. I wish I can contact you via phone. I want talk to you to explain my deepest gratitude 🙏🏻. Bless you More and more . You are priceless brother

  • @TheSilent333
    @TheSilent333 3 роки тому +7

    I can never thank you enough for all your wonderful videos, Venkat. You have a gift for explaining things in an easy to understand way. My current job is requiring more advanced SQL than I've ever had to write before, so I always check your channel for help if I run into any blocks.
    Cheers!

  • @srinivaspachika1996
    @srinivaspachika1996 3 роки тому +4

    Thank you so much for creating the SQL playlist, sir. It's one of the best SQL tutorials available online!

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  3 роки тому +4

      You are very welcome Srinivas. Means a lot. To be honest feedback like this motivates and keep me going. Thank you very much for taking the time.

  • @rohandesai5681
    @rohandesai5681 3 роки тому +1

    Hello Sir,
    Just wanted to thank you for creating SQL Playlist. By watching these videos it gets easy to crack an interview. I want to ask you that could you please create the same playlist for SSIS, SSAS, SSRS, and Power BI if possible. It would really help us to understand the concepts as an MSBI Developer. Thank you in advance and looking forward to your reply.

  • @akshaykumar5337
    @akshaykumar5337 2 роки тому

    Hi Venkat, Thank you so much for sharing amazing content. I have a quick question could you please let us know how to avoid these scenarios in real time.

  • @bakarali1818
    @bakarali1818 3 роки тому +1

    Hello sir, First of all I would like to Thank you for your effort for us.
    I want to ask you that will you Please create a course for Database Design.
    Because I have searched this course on youTube so much but I've not found a single course that is easy and understandable as your content.
    Please ans..
    Thanks!

  • @divyareddy6767
    @divyareddy6767 3 роки тому +1

    Awesome Explanation sir

  • @divyareddy6767
    @divyareddy6767 3 роки тому +1

    Thank you so much for videos sir

  • @saipraneeth1660
    @saipraneeth1660 2 роки тому +1

    this is the question it was asked for me yesterday interview I have answered only two correctly 😅

  • @pavankalyan9267
    @pavankalyan9267 2 роки тому

    Great explanation ✌️

  • @adityaubale528
    @adityaubale528 3 роки тому

    Hi Sir,
    Hope you are doing very good.
    Your videos are very very helpful.
    Your voice is changed. It different in C# videos.
    Wish you have a long life.

  • @ericahsan2186
    @ericahsan2186 3 роки тому

    cloud you please tell me how can I download the database that you are using to practice? thank you.

  • @kickOffLiveTV
    @kickOffLiveTV 3 роки тому +2

    Hlo sir, will you continue with git and angular 6 playlist?

  • @AlexTheUruguayan
    @AlexTheUruguayan 3 роки тому

    This is fun because it takes us out of the data we see in our day-to-day. Usually we join normalized tables using an identity column and so there is no repetition of the IDs and so an inner join would never end up looking like a cross join.

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  3 роки тому +1

      You are 100% correct Alex. We wouldn't see something like this in a real world application. May be the interviewer who asked this question was trying to see how good the interviewee JOINS knowledge is.

    • @AlexTheUruguayan
      @AlexTheUruguayan 3 роки тому

      @@Csharp-video-tutorialsBlogspot Yes, of course that's the only reason for the question. Unless the interviewer is giving a subtle hint to the interviewee that any DB work at that company is going to be hell because they haven't normalized anything and don't know what PKs are. :D

  • @mr.prasadyadav
    @mr.prasadyadav 3 роки тому

    U are wonderful teacher in the Software Environment ..

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  3 роки тому +1

      Thank you very much Prasad. Hope you are finding our free courses useful.

    • @mr.prasadyadav
      @mr.prasadyadav 3 роки тому

      @@Csharp-video-tutorialsBlogspot if it is possible please do More Example Videos on User define Functions Sir

  • @Saheb774
    @Saheb774 Рік тому +1

    what if table 1 has 1 column with values (1,2,2,Null) and table 2 has 1 column with values (1,2,2) the join(left,right, inner) query output result is confusing. Could you please help to understand it. thanks in advance

    • @swarooppabbineedi1820
      @swarooppabbineedi1820 Рік тому

      Today the same question was asked for me in the interview.. What is the answer for this question please tell..

  • @vauvau1823
    @vauvau1823 3 роки тому +1

    Heelo Sir, thanks for your job. just one question: your c# playlist in your UA-camchannel is always availabe?
    I ask it because you made video since 2012. Thanks again

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  3 роки тому +4

      Hello Vauvau - Yes, it will always be available just like every other video and playlists. Hope this answers your question.

  • @chakrigovindarajulubingi459
    @chakrigovindarajulubingi459 3 роки тому

    @kudvenkat ... Explanation is really superb. But if the column A [1,2] and column B [1,1,2] . Then the output will be 3 rows right

    • @Niteshkumar-ly2ip
      @Niteshkumar-ly2ip Рік тому +1

      Yes except cross join which have 6 rows in the input

  • @technicalcodewithaj
    @technicalcodewithaj 2 роки тому

    Missing you venkat😢
    Start uploading the videos again👍

  • @Engineergauravdixit
    @Engineergauravdixit 3 роки тому

    Very nice 👍, I have a doubt "does it mean every join always do Cartesian product then it filters result based on join type and condition or this happened here because of special case of duplicate data?"

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  3 роки тому +1

      Hi Gaurav - Sorry if I have confused you. No, the other joins like inner join, left outer join, right outer join, full outer join does not behave like cross join. In this case they return the cartesian product because the join columns have same values as you said. Thank you for taking the time to ask this question.

  • @g.suresh430
    @g.suresh430 3 роки тому

    Hello Sir, I am Suresh. I have watched videos regarding recursive CTE but I was unable to understand. Please make a video by explaining below 2 Queries Like you explained part 3 How does a recursive CTE work with the help of excel. It's my Humble request. Thank You
    ;With CTE
    as
    (
    select ID, Name, Occurrence from #Task
    Union all
    select ID, Name, Occurrence - 1 from CTE Where Occurrence > 1
    )
    select ID, Name from CTE Order By ID
    Go
    ;With CTE
    as
    (
    select 1 as Number
    union all
    select Number + 1 as Number from CTE where Number < 5
    )
    select * from CTE

  • @user-qz9st1ut4b
    @user-qz9st1ut4b 8 місяців тому

    very helpful video's but Where is the original Venkat?

  • @pawansahu167
    @pawansahu167 2 роки тому

    Your voice has been changed.... Totally different if it is compared with your SQL server tutorial 10 years ago

  • @agarwal89mohit
    @agarwal89mohit 3 роки тому

    Hi Sir,
    Pls answer Display nth row in sql Server, how to find alternate rows in sql server and how to find first and last nth rows in sql server

  • @maheshtej2103
    @maheshtej2103 2 роки тому

    From table A only one column is there ? How can you select coulumn B from table A

  • @hasyahaven
    @hasyahaven 2 роки тому

    Is this particulat to this scenario. For eg when i try with a different example say Drop table Departmen
    Create Table Departmen
    (
    DepartmentID int primary key,
    DepartmentName nvarchar(50)
    )
    GO
    Drop Table Employee
    Create Table Employee
    (
    EmployeeID int primary key,
    EmployeeName nvarchar(50),
    DepartmentID int foreign key references Departmen(DepartmentID)
    )
    GO
    Insert into Departmen values (1, 'IT')
    Insert into Departmen values (2, 'HR')
    Insert into Departmen values (3, 'Payroll')
    GO
    Insert into Employee values (1, 'Mark', 1)
    Insert into Employee values (2, 'John', 2)
    Insert into Employee values (3, 'Mike', 1)
    Insert into Employee values (4, 'Mary', 2)
    GO
    select * from Departmen
    select * from Employee
    select DepartmentName, Count(e.DepartmentID) as TotalEmployees
    from Employee e right join Departmen d on e.DepartmentID = d.DepartmentID
    group by DepartmentName
    order by DepartmentName
    select *
    from Employee e right join Departmen d on e.DepartmentID = d.DepartmentID
    --no of rows returned 5
    select *
    from Employee e left join Departmen d on e.DepartmentID = d.DepartmentID
    --no of rows returned 4
    select *
    from Employee e full join Departmen d on e.DepartmentID = d.DepartmentID
    ----no of rows returned 5
    select *
    from Employee e inner join Departmen d on e.DepartmentID = d.DepartmentID
    --no of rows returned 4
    select *
    from Employee e cross join Departmen
    --no of rows returned 12 so this is not a general scenario where joins return a fix number in result everytime.... just posting cause when i first watched the video i thoight this is always true when using joins.. so i thought i put this up.....
    thanks for the great content though!!

  • @002TheTarun
    @002TheTarun 3 роки тому +5

    Sir please make tutorials for Data structures and algorithm using c#

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  3 роки тому +1

      Hi Tarun - Great suggestions. Sure, we will after Azure tutorial. Thank you for understanding and your patience.

  • @RebwarAhmed88
    @RebwarAhmed88 3 роки тому +2

    Hello sir,
    do you have plan to pulish Azure course please?

  • @sirivennalasanam6078
    @sirivennalasanam6078 3 роки тому

    I feel previous Vedio s voice is different in this vedio voice may be he is not Venkat

  • @mohamedmustafa7275
    @mohamedmustafa7275 3 роки тому

    Thanks for your videos. I am working as a desktop support. Is this possible to change my career to DATABASE.

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  3 роки тому +1

      Hello Mohamed - You are very welcome. Sure you can Mohamed. Our free SQL Course can help.
      www.pragimtech.com/courses/sql-server-tutorial-for-beginners/

    • @mohamedmustafa7275
      @mohamedmustafa7275 3 роки тому

      Thanks Mr.kudvenkat

  • @sravankumar1767
    @sravankumar1767 3 роки тому

    Good morning sir, Happy Dussera , can u make videos on SSAS Tabular model...

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  3 роки тому +2

      Morning Sravan. Happy Dussera to you too. As I promised to many people we will start Azure tutorial next. May be sometime in the future I will do a video on the tabular model. Thank you for your understanding and patience.

    • @sravankumar1767
      @sravankumar1767 3 роки тому

      @@Csharp-video-tutorialsBlogspot Thanks sir.your way of explanation is awesome 👌

  • @nandhinibaskaran7578
    @nandhinibaskaran7578 3 роки тому

    What is the reason sir. My guess is we are joining columns which is having same values.....

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  3 роки тому +1

      Hi Nandhini - Yes, you nailed it. 100% correct. It's because of the matching values on the join columns.

  • @Alpacastan21m
    @Alpacastan21m 2 роки тому

    Amazon Data Engineering position, question was asked.

  • @cheruvuramesh5304
    @cheruvuramesh5304 Місяць тому

    if both the tables have only one row each with the same value, the result will be same !