SQL Complex Queries , Query Optimization and Interview Questions SQLServer 2016

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone my name is Yogesh and today i will be recording lecture over complex queries into equation sequel server 2016 now this lecture is a second part of the previous lecture which was just complex queries into a question in sequel server that I recorded a long time ago now because of the new features we came like into sequel 2012 in 2016 so I wanted to show you those also in this lecture we will be covering few entry question which are practically interview questions you can relate to them because those are generally also introduced second these functions which features I will be telling you like new features each have came into 2012 and 2016 T sequel which helps you to write a single line of query which can do a task of like that 20 or 30 line of code which you have to custom Li design so these things are very important and third one was one query I will show you one question came in - one written test that also like they have given a query and they asked for optimizing so I will show you that one query now just know because only one query I am covering is because there will be a separate lecture or performance optimization but for now only one query I will be covering so now before starting this lecture I will be telling the first thing I will be covering this one and the database I am using is Northwind which you can find online but also I have added few new table so I will be uploading this backup for this database as well along with my this sequel script so that you can use this database for our you can subtract this now I will be starting with sequel 2012 and 2016 TC cool features so before starting that I want to brush a brush up you al are like regarding this over operator because there is a a lot of new things came with this / operator and I want you to be like fully aware of the concept there may be people who will already know but I just just for brushing up I wanted to show you like what this operator do now the basics the simplest function which is used with this operator is row number now the people who know the row number they can understand easily but if you don't know doesn't you don't have to worry it is simple function provided by sequel server in this with this function you can generate sequence number with each record whatever the row is returned by the signal your select query now along with this row number you need to use it is mandatory to use this over operator and within the other operator you have to provide according to what order row number should come now as I am getting data from categories and product table I am getting category name and the product name so row number I am producing on the product ID because one category can have multiple product so I want this row number for each product instead of just for the category so and also I want it to come as a product why is not as a category voice so if I run this query it give me a simple output one is this row number column which is just a continuous sequence of number second category name and the product name now this is a simple one use of this row number and over operator now there is one requirement like you can see there are multiple categories like beverages condiments produce and so on seafood so what I want is I want to produce this row number but I want that row number to reset whenever a new cating he comes like for one category like there are 12 products it will give one to fill for the next category when it start again it should reset the row number by one so let me show you this query output now here you can see for one category I have this 1 to 12 sequence whenever the new category start it reset again to 1 so here you can relate and there is one more column which is just a continuous number like a previous one so how I am able to do that I am using this row number function with this over operator order by product ID is name just one thing I added is partition by category ID so whenever the new category ID will come it will reset the value again to the one so that it will like show you like there is a row number happening for each category like a partition are created for each category so you can see how it happens is I just added one more extra thing within the over operator that is partition by category ID so this is just to show you how like partition wave works to add up one more example to it is like right now if you see this query output what is happening is we are getting this row number for each category resetting to one but this is continuous row number so here what I want is only one number to be assigned to the one category means for beverages it should be all one for condiment it should be all two and like this sequence number so how I can do it I am using here dense rank function which is also like a row number function but it gives ranking ranking means for one value only one rank will be assigned so for beverages only one will be assigned for other category one more number to be sent that will be unique to it because ranking is them because for the same values only one number will be assigned so let me just show you the output so here you can see for beverages all like a category why 0 number is one for next category again it is set to two then continues for the confection again then dairy product set to four and so on and also this product wise row number is automatically resetting whenever the new category is coming you can see so this was just an introduction to you like regarding row number and density function and partition by clause partition by operator within this over operator now now the main things come now before that this is a simple query here what I am doing is I am joining two table one is product and order details table and what I am doing is I am getting the product and the total quantities a total amount a mo u NT sorry total amount of that product has been sold so if you see the output it is just impulse this product has been sold for so many dollars so it is very simple to understand now what I want to I will be using this query as a sub query so here you can see the same query I copy pasted and giverny like Alice's P and now what I am doing is I am using again some I am saying product name total amount whatever the output of this query second I want to sum the total but here you can see there will be no group by because I am doing it on the tls so now there will be no grow back I am summing this total and I'm over and order by product name one column is they're basically product them so second column I already doing summation so what I'm saying is some the total amount and like over using over operator order a product name so what it will do is it will generate you a running total value now what is the running total now for the first value it is the same but for the second value it add these two value for the third value it is adding all three values for the fourth value it is adding the all fourth value four values and for the fifth it is adding all the five values or you can say it is adding the fourth running total with the next value so kind of like for running total added to the next one is equal to the next running total so this is how you can achieve the running total now the people who are in the reporting or in the or in any like place where they have to present the data they know running total is very common thing asked by the Clyde because this is the cumulative value so this is how you can achieve by using some operator or any aggregation operator and using operate like / operator and giving the order by now the question is now I can see product is their total is there running total is there now there is also category so what I will do is do the categories what I did is I just added one category ID to the this one to the output you can see category ID is output added to the same query and second I am what I am doing is I am joining it with the category stable to get the category name so why I am doing this is to get the running total value but it should reset whenever the new category is coming so here you can see running total values incrementing for this beverages the moment next catechol comes this is that this condiments the next category come it again reset to the initial value for the next category when confections comes so again you can see it is set to the this one so how it is working is it is same totem same what I am doing is I am summing the total order by product name but partition by category ID so what I'm saying is whenever a new category comes also that he said the you are running total so it is very simple and you can see how this can be achieved by just single line of code and I know the people who are from the reporting background they know how it is difficult however stiff achill it is to set these running total again back to the initial value whenever the new category comes they can do on the reporting but from the query side it was very difficult previously so now this was all about this over operator now coming toward to new function that is that our lead and lack now what this lead and lead function do is for need I can get the front or like is the next row value or next or any you can see upcoming low values and with the lag function I can get the previous row value so here what I am doing is I am getting the customer ID customer company then ordered it whenever the person the customer place order also I am getting the next order date then the next order is placed and when the previous order was placed so let me just show you the output now here for the next order value now you can see it is a 25th state and for the next order is 10th month in third date and you can see in the next order value I am able to get the next order so here you can see for this one after third there was next order on 13th so I can see there is a thirteen really so this was the lead function now this is the lag function so for the first record there will be no previous value so what it is doing is it is getting the for the second record it is getting the first record value here and for the third record it is getting the second record value now why this is required because let me give you a simple example where this query implies suppose you have a customer base and your management ask you to get the customer who purchase who place the orders more frequently now how you will be able to just if I like to figure it out which customer player like place order frequently by getting their order history and how you will compare is you will compare their current or like one order with the next order and see what is the difference between number of days difference between those two orders like one day to day 100 days so you can with that nowadays difference you can figure it out like which customer is placing frequent order and which is which are not so how it is working is I am saying same lead the get me the next order date over partition by why I am doing with this one race because if you see the output for this customer when I am getting so for the next order for this customer only I am getting when the new customer comes then I should get the next order for the new customer so I have to reset this again and again so wherever there is a reset there will be a partition by clause and so what I am doing is partition by current company name so whenever the new company name comes again start you can say fetching from the new company instead of doing it from the old and order by order date so if I get my output so here you can see whenever so so this is like six three cords so this was a sixth order of this customer so there is no next order so there will be null and for this one first order there will be no previous one so it is none so you can see for the next customer again the last value while a sorter have next day ordinal and for the previous the previous day so that's why the partition by I used so here you can see and you can understand now this leader lack you can search it on google and do some more practice because just not the next rule you can get like like three rules leaving and getting the fifth through a data and four through so that thing you can try and figure it out but this is whenever you have been asking interview or in a written test how do we get the next order value at all so here these are the function which can help you now coming to the further more things it is the same query which is I am using above so what I am doing is Here I am calculating the day difference which I told you like getting the most frequent buyer now let us see what is the history so what I am doing is I am just getting the date dip in the date difference between order date and the next order date which is these two and Here I am able to get 39 and also for this customer I can see this customer place all the orders within the 100 days but if I see the next customer needs placing like very rarely like after 324 days or 112 days so this is not the frequent buyer but this is the potential frequent buyer because you can see the different day dissonance is decreasing instead of just ink but the next customer also you can see so here you can see the day's difference is degree it means this customer is happy with you so if there is a customer whose day is de creer days are increasing then there is a problem you have to call the customer and ask like what is the problem and so on but the thing is these kind of report help and now because of this lead and lag function it's now very easy to get the values and all within the sequel server you don't have to go to create SSRS report and on now after this I want to brush you up with the basic concept of paging now if you are a dotnet valper on any developer you will be able to like relate to this one now in this sequel service suppose you want to do a paging now what is spacing is suppose on the UI there are like the person is showing data in the grid and in that grid it is showing 10 record at a time your table is having thousands or millions of records but it is showing only 10 records so on the first page the record will come from like you can say row number 1 to 10 for the second page the record will come from 11 to 20 for the third page record will come from 21 row number 2 13 through number so how you calculate is with these three valuable are two variable I am using is page number and page size and then start page and end pitch now page number which page number I want to get and the what is the page size so start pages likes page number into page size that is like 10 into 3 30 minus the page size that is 10 so it becomes 20 plus 1 because this will be my first record 20 because of for the third page what is the first figure 21 to 30 eighth row number and for the end row it's directly page number into page size so this is Here I am able to get these two values and here what I am doing is simply I am generating the row number 1 2 3 4 and outside I am adding a between Clause between start and end I want to get the root so I am getting the 3rd page so I will be getting 21 to 30 now why I am showing this one is because if you are at all / you will be already knew about this one like this logic but this logic was used previously now a new thing came is offset and fetch in sequel server if suppose you want to skip first because a third page number as I told you it means 21 row number to 30th row number means you are skipping first 20 so in this simple sentence what you have to say is you want offset 20 means you want to skip first 20 order by you have to give any um without that it won't work offset you are saying like I want to skip to Ontario's and then I want to get 10 next 10 records so if I run this it is getting with the same output but the row number is not coming that you can anyhow generate now the thing is if I just see and compare the execution plan of these both queries you will be able to find out yes there is a difference this query old row number mechanism is quite expensive compared to the this offset and fetch 1 and if you see the rows other than this row number column you can see the data is matching so now for paging you don't need to write that same again complex you can say like not even the complex about the traditional thing you should not use you can use this offset and fetch also I just made it dynamic here by doing the variable instead just you directly writing 20 and 10 I am just replacing it with the formula so that you can see like you can make it dynamic as well let me just turn of this execution plan okay now there are like as so many function I have showed you and I like over operator we can see we can use lead-lag some with this over operator then we have this offset and fetch thing now there are two more function that is first value and the last value now suppose like the same example let me just show you first and then we'll discuss suppose you have a situation where you want to find the difference between the order date compared to the first order when the customer is placed or you went to you can say get the difference with the last record when was the last order placed with all the orders so you need the last in first value so how you will you are able to get this there are two function new functions are there that is first value and the last value and the syntax is totally same partition by customer name and order by why you select one is like in whatever order they are in so you can use anything whatever you like as per your data so if I execute so what I am getting first value of this group so the first order was placed on a 25 so a 25 all the rows and the last order was for nine so all the rules are for nine now for the next as I am partitioning by caste the company name so for the first order is on three four so all are three four and the last order was on nine eighteen so last order was nine eighteen so like getting the last and first value along with all the records so you can use first and last value functions so as now you can see so many things are there so this query is built to show you like as I told like recommendation I want to mix so if the customer is like what I am doing is everything is same I am able to get lead and lag like de force in next order then what I am doing is I am calculating the average difference between two dates in here in this query and when I'm getting is I am just giving them a number one two three four one two three four why I am giving them okay let me just show it to you so that it should make more sense star from CTE to so why I am giving is like I want to differentiate between like two means like normal or you can say frequent by our three means is good or something like that I want to give them so what I am doing is Here I am calculating that date difference between the same what we were getting above and as for the date difference like if the average date difference is 30 then the give the tag 1 if it is 30 then gives the tag greater than 30 gives the tags 2 or some and between 90 gives the two and greater than 90 gives the three and so on so kind of that so this why I am doing is later on I am using this choose function which came in sequels over 20 68 2012 in this you just need to pass a number and the values array like the comma separated so if the value is coming 1 it will give important if values coming - it will give recommended if values coming three it will give normal and if it is four then ignore so let us see the output I know I have just taken a complex example to just denote the simple functions but you can check it later as well but let me okay so you can see the output as per the flag I change the value so here this is a simple representation of this one there are two function one is IIF if you are reporting user you already knew this function if you are not so what this function is doing like a case Clause like you have to do a case and all that you don't need now so you can do like if 1 equal to 2 then a else B so it is giving else now if I run it again so it will give me a now so it is directly case statement or also like you do the nested case you can do nested if here what I did is then if and then if but there is a one thing it can go up to 35 level that the same you can second-straight applied to the case statement you cannot nest more than 35 level then there is a choose as I told you this is the comma-separated array of the values and here whatever the values we will pass in the first one like third value you want to get so it gave you ghost if I say one it will give me error sorry hello so here you can see so it is simple if you give something which is more than that it will give null so it's very simple now there is one more thing that is called as concat function came in sinkhole 2012 and stem using in 2016 why I am using is let let me just make you she will show you example so here what I am doing is I am declaring two variables where 1 and y 2 where one has best and second has friend so here I am can get anything with plus operator and here i'm concatenating using concat operator can get function with comma separately so the output remains same but if I make this one as null and if I see the output again so the first become null because adding best with space and then with null it becomes null but can cat is able to handle null properly so now if you want to be get rid of any problem related null coming and nullifying your output you can use concatenate is very good for concatenation the string now these are other complex queries now as I told you initially we will be covering few interview questions anyhow these all this question I covered these are also interview question you can use in written test or something like that but these will be the entry question which I came across so now this is one simple question now in this what I have is I have one table called cities and basically have adding countries so sorry for the miss giving the wrong column names and all but the thing is suppose I have four teams and I want to set the match between all the four teams like India versus Australian deposition like and India vs. England and so on so like if there are ten teams and between them but what I want is I should not repeat it like India vs. Australia happens then Australia versus India should not happen because it's already happened so how I will be able to do first I am got the data in this temporary table second what I am doing is I am joining the same table but not with the same ID what I am saying is that because I have to do the cross join why cross join because I have to create a pair with India with all three Australia with other three XI linka with other three so I have to do a cross UN you can say outer do outer join so here I inserted that into team so here if we see the team data here you will find all the combination Australia versus India also and India vs. Australia also India vs. Australia also so now this is like a raw data now we will filter it out means if Australia versus India happened so India vs. Australia should not happen because it's already the same now how it works is if you see one thing for this record from ID is equal to so alike here Australia vs. India and India vs. Australia then these record happens so from my ID is equal to two ID for this record and two ID for this record is from ID for the other record because these are like ID to those countries so anyhow these represent these two record represent Fromme becomes 2 & 2 becomes from in when the countries are same just the values of crisscross so what I have to do is I will be getting adjoining this team with team where from ID of as I told you from ID this one equal to 2 ID of the next record and 2 ID of the current record to the from ID of next record so I want to get that output but I want to get where from ID is less than 2 ID why this condition if I do not put this condition it won't ignore the other values where the values are same because again it gave India England and England India so to ignore that I added the condition I want to get the first record whatever is coming like Australia versus India is coming so let it come so here you can see Australia or say India is there but there is no India vs. Australia she'll uncover say India is there but there is no India was the Sri Lanka so kind of with this condition I am able to ignore the values which are like noise values which I do not need so when you will I will be sharing this script so you can just run line by line and see how it is working ok now coming to the one more question the second highest or NH higher cell rate let me make it an advanced so why this is very important is because this is the very common interview question very very common native question you will find you have employed table or a student table or any table get the second hair cell you're getting the student which have the second highest marks and all so how this works is suppose your company is having 3 salaries like sixty thousand fifty thousand and forty thousand suppose this sixty thousand there are ten people for this one there are fourteen employees in your company and for this one there are 16 employees come but there is one thing common what is the second highest value which has only having one salary later than it I'm not talking about the people I am talking about the celery what I am saying is if I talk about third is celery third I a celery will be the celery where there above there are two salaries more than that in the organization which are five two thousand six two thousand so if I say for science means there is zero zero celery above this celery so it is always one less if it is the first record there should be zero record above this one if it is second record there should be only one celery above it or if it is the third then there should be only two celery above it so that you can understand that is minus one third means there should be two two means there should be one and one means there should be zero so here in this query this n minus 1 denotes two that if it is 2 it should be 1 I like you can say above celery above it so I am doing is I am having this employed table and creating the sub-query joining out an employee with the inner employ where I am putting the condition in a reply salary is greater than outer employ celery and getting distinct count of the celery why distinct count because as I told you if there are 10 people so the thing is if I see like I see what are the number of cells is above 50,000 so it will give me the 10 records because there are 10 people if I do the distinct celery it will give me only one that's why I need a distinct clause here so here I am saying calculate the count of celery which is above my salary if that count is there expose I'm getting secondary it's count is equal to 1 means only one salary is greater than me then that is the person you can see that is the salary greater than me so means I am the second highest selling so if there is any record which is having you can say like to sell this above me people who are having sell this but if I calculate distinct salary and getting to records which are above me means I am the third highest cell repair getting you can secatur so here I am gable to get the second highest if I have to get the third highest sorry so I can get these are the people who are getting the third eyes you can say a third higher salary the 15,000 and if I do it one so I got the salary which are the maximum salary so just to clarify what I will do is I will just show it to you all so there are only these salaries so the first is oh wait a second order by celery descending so you can see the first is 70,000 as our result cave and the second is 60 and third is 50 so let us see first this 70 these many people are on the 70,000 salary on the $60 only 1% is there and on the third there are so many so this is how you are able to get but why this example itís just not because it is very common but there is one more question it was asked they want second hair cells a as per department now here the complexity comes now as I told you what this ranking function do for each value it will assign one number so suppose there are 10 people having 15,000 cell 3 so it will assign them only one number as a rank if the purse there are 1020 people having 60,000 cell 3 they will assign only one so suppose there are 70 60 50 thousand so it will assign only 3 next all people with 70 will assign one all people with the 60 will assign to all people with 50 will assign B you can say 3 so hi I am doing is I am saying partition by Department because for each department I want to the rank all the people and order it by celery because as I told you for each cell rate will give a only uniquely with this what I am able to get is all the people and what are their ranks as per the celery second out because now as I told you for second highest now if you see the example now human resources for people first three people are getting 70,000 so rank is one and the fourth person is having 30,000 so it is getting to rank now as I'm partitioning by partitioning it again by you can say Department so for each department then act will set again back to one two three now if you see this information service this has three people having 50 14 13 so all three are different so one two three is assigned for marketing or you can say production let us take so in production what is happening to people are on 77 70,000 so those go to rank 1 2 are in 50000 got rank two and two other 240 and thirty two three and four rank is good so you can see Rack is doing our task so means the second highest salary will be where the rank is too simple okay aspect Department so I am partitioning by Department so this is one of the simple question they ask now there was one more thing like we have employer table and the employer table there is a manager ID this is very common question in CT you usually people use this like recursive CD creating like I want to get all the people who work center my manager ID to like there are three people directly and there are under those three peoples are at four people more so and so I want to get all the child so it's very simple this is a recursive CT the first I am getting direct child to manager so I got this then I am giving the CT and in the union all I am joining employee with this CT itself so means if there are these three child's are of manager two like you can say employer manager too so if they are manager of someone so this employee ID will be their manager ID so that is the basic simple thing I am doing what I am doing when I am joining this employer with this CT Here I am saying manager ID should be equal to the CTE employee ID okay because already these will become manager to some other person so this I am joining and this is just recursive city it will automatically get you all the child's under who works directly or indirectly under manager ID to okay now getting the duplicate record this is very common questions but comes with the different different variations now in the employ table they want to say like there are some to click it people like entries for the same people duplicate the entry how you can sto like identify four same employee ID if two records are there for same employee ID means that is duplicate because employee ID should be unique so what I am doing is I am generating the row number as it is whatever the sequence is select one means whatever the sequence just give me the same sequence so I got one two three four generated now what I am saying is get me all the records where the row count you can say row number count is greater than one where employee ID for inner CT is matching with the outer CT so I am matching the employee ID but the row count so suppose there is like okay let me just show you the first example suppose employee ID one is passed so here one is passed means I want to get if I just oh sorry I have to make it one let me make it one and turn the sub-query simple sub query so it will give me okay it's because of CTO sorry so if I I don't run because it is connected Ct so what I am doing is for employee ID one it will pass one here so I am getting wherever there is one ID equal to like outer city is equal to I am joining within a city so means suppose there are two records for one ID it will recur give me to row number count means there are two row number exist so if there are like employee ID - for the employer ID - suppose only one record exists so the total number of row number are only one so with this one I am able to get the duplicate records here you can see for employed in nineteen there are two row numbers so what I'm saying is if the row count is you can say greater than one and something like that okay and now comes the PV eight one period there you see there is for this CT recursive this is a special lecture I think it is like grandparent and child relationship I have lecture I will share the link in the description of this video you can find there so that you can be cleared with the CT and how this recursive CT works second this PV 8 also we have a separate lecture so as this was the same trivia question so I just want to get show you this one so it is just nothing I am getting you can say Department and here in which here how many people join now if you are aware with the pv 8 pivot what you do is it can generate you can say translate you can say transform your data from row wise to column wise so what I am doing is I am generating column for each year and showing the more like a number of people joined in that so here you can see in humans is one two thousand six one percent event for two thousand eight two percent two hundred two thousand nine one percent you so so on so pivot is a simple one so here you can see as this is a query so you can just look into it okay now there is one more interview questions it was asked was like there was a string given they just asked like they want to get a number of correct you can say number of spaces within this string so how it happens it will calculate the length of the string subtract the length of string after replacing space with nothing so it will give you the count of space within the string it's simple but there is one difference if there is a space like in the end so length function ignores that so for that you need to use data length function because length function don't include the you can say post like string spaces at all so data length give you proper example now this was now this is the one which I was talking about this is simple query what here the person is doing is he is selecting the students and getting the date of birth date a year when the student was born and getting the maximum date from the table student for that here when this in the DOB section so suppose you are like the born in 1991 so this sub query will give me when was the last strange Bowl in the 1990-91 so the record for the last child will be written so this is one query I will show you how bad it works it takes around one and a half minutes to just give you the output let's wait for a minute sorry okay in the meantime it executes I let us cover what we covered was we covered over operator with row number and density function also then we did running totals here using over with some which comes up in 2002 2012 - the sequel 2012 and still working in 2016 then we use the partition by for each category we again reset the running total then we use the lead and lag function with this over operator so everything is related to over operator in sequel 2012 and 2016 but there are lot of function related to formatting and date/time operations but those are not you can send logical ones like using as but the logic those are like value oriented single value given giving functions and also that's why I just called over operator then we use lead and lag to calculate the difference between the next order for the place by the customer then we did paging with the normal way and the second we did with offset and fetch then also be used first and last you can see first value and last value functions to get the first value over the last value order claims by the customer partition by customer and then we just use this one if I F and choose and I showed you how the concat works in sequel 2010 we created this complex query interview portion for this creating match with all the countries with each other without repeating vice versa scenario then n a higher salary then getting the second higher salary as per the department because the department was second higher salary then getting the all the people person directly or indirectly working in Terminator 2 using recursive CT as I told so and then was finding the duplicate rows and then this previous query I showed it to you pivot is simple so you can look into my other lecture to understand how this PV it works then calculating the space using length and data length so as I told you the length function ignores the you can say at last spaces and also data length you need to use because you if you are calculating length of a password you need to use data you cannot ignore because space is also calculated as a character now coming to back to this optimization of this query now this query took around 1 minute now second give 384 records now what is really happening in this square is getting the student getting its ear and getting the last date of birth when the person was born in that year so means for all the student it will pass the year and we get the last date of birth for that here means if there are 100 student of same here there it will get the 100 times the last data or date of birth for that year okay so how we can simplify is as I just need here and the last date of birth in that year so I use CT so first I got the query here and the last date of birth and then I just joined this CT width student on the base of data birth and if I execute the same output can we get in 0 second almost 0 second and 384 records the same data so this is how I just optimize this query so this was one of the entry Goshen and I found it interesting to include in this lecture so I hope I have cleared you all the things but if you still have any confusion you can contact me through my email id that is you get our mail at the Gmail using my skype ID and I will be uploading script and the database backup on website that is text 14 and my YouTube channels text file you can subscribe to it for the latest in any new lecture upcoming this also you can contact me on my phone and that is plus 9 1 9 0 to 3 to 6 so 8 to 6 2 5 to 0 so you can contact me through my phone also I also online on whatsapp so you can contact through this number I hope you'll like you liked the lecture if there is anything I know I am little bit fast but I will be uploading the script and a database backup so you can execute line by line if you have any question as I told you you can contact me anytime so stay healthy keep learning thank you
Info
Channel: techsapphire
Views: 147,662
Rating: 4.8392954 out of 5
Keywords: SQL, Query Optimization, interview question, complex queries, DENSE_RANK(), ROW_NUMBER(), SQL Developer, SQL SERVER 2012, SQL Server 2016, SQL Server 2008, SQL Tutorial, Introduction to SQL, Database, Oracle, Performance tuning, SQL Join, Complex Join, Written Test, OVER, Operator, Partition by, Order by, Lead, Lag, first_Value, Last_Value, IIF, Choose, CTE, Programming Language, PIVOT
Id: -t-8-xoLyv4
Channel Id: undefined
Length: 42min 26sec (2546 seconds)
Published: Sat Oct 21 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.