SQL Query | Compare with Previous Quarter's sales | Analytical Functions | Lead | Lag
ฝัง
- เผยแพร่เมื่อ 8 มิ.ย. 2020
- This SQL video tutorial explains the use of analytical functions - Lead and Lag.
Example - Compare Current Quarter's sales with Previous Quarter's sales.
Please do not forget to like, subscribe and share.
For enrolling and enquiries, please contact us at
Website - knowstar.org/
Facebook - / knowstartrainings
Linkedin - www.linkedin.com/company/know...
Email - learn@knowstar.org
Great tutorial!
This video is really amazing! Your hard work and knowledge really shows! Thanks a ton!! 👍
Thank you 🙏
These videos are so good to revise the concepts and prepare for cracking the interview.
Thank you. Glad it is useful.
I have an interview on 4/20 and 4/21 2022. I swear I will finish all your SQL query interviews questions within 2 days, today is 4/18. fk that, I am on fire!
Wishing you good luck for your interview 👍
@@LearnatKnowstar thanks! I have done all leetcode question, but I just realize the most interview questions are here. THanks for posting these. I'm on fire!
If I want to substract from lag(startdate) to get previous date i.e lag(start_date)-1
Can you help?
Hi sir is it possible to use LAG next in sum query? I mean LAG(sum(sales))? Thanks
Great Explaination. Hooked to your channel. Could you please guide me on how we can just compare Q1 with Q4 of previous year. Thank You
Hello, Please check out our latest video. it will help you with the logic
th-cam.com/video/CDGwVXknZXI/w-d-xo.html
I have question if We need only difference between q4 and q1 sales for 2019 how can we get?
Your videos are great. Could you also please provide the SQL script to create the sample data and the queries? It would be really helpful for learners.
Thank you. I have been planning to put the SQLs for sometime. Will be doing it soon 👍
mam app agar database or table create kr ke wo v show krte to or b acha hota samjh ne may.
Excellent 👌👍
Thanks a lot
Good eg
Hi thanks for the video. I have a question pls. What if you wanted to compare 2019-Q1 against 2018-Q4 in the same SQL
You will need to calculate quarterly sum instead of monthly and go back by an offer of 1.
Here is a link to a similar video -
th-cam.com/video/rGapnGwEWIU/w-d-xo.html
Super ....
Thank you
thanks ma'am
Thank you
plz include video for YTD and MTD (month to date)
The video is coming next week. Stay tuned.
Is this playlist helpful for freshers to get job in SQL developer domain
Yes, it will be helpful. You will need to practice the SQL Queries.
Nice 👍
Thank you 🙏
Great content! Can you share the sample database you used?
Thank you. Unfortunately, we do not have the database for older videos but we are including the database and sql statements for all latest videos.
@@LearnatKnowstar can you share the databases you currently use for the latest videos?
Please share the dataset for the same
A (Student ID, Student Name, Student Age)
B (Student ID, Student Class, Student Section)
Select Student Name, Student Class, Student Section where Student Age between 16 to 18 and Student Section is 'D'
How to find mam ?
What in case, a quarter's data is missing?
It would compare with the previous quarter for which data is available.
If we need to take into account the missing quarter, we first would need to create a dummy record for the missing quarter.
Isn't it a wrong solution?
The question was "Compare sales of quarter with previous quarter". Solution is "Comparing sales of quarter with previous quarter within same year".
And generally, we compare quarter with previous quarter either within same financial year (i.e. Q2 with Q1) OR with same quarter in previous financial year (e.g. 2019 Q1 with 2018 Q1).
3:55 "Because there is no corresponding previous quarter for that"?
Completely wrong statement.