Hi All,
My name is Ankit Shrivastava and I am a Data Engineer.
Today this #vlog is regarding #sql
Calculate total number of business days between two given dates considering following factors :
1. Consider weekends
2. Consider holidays
3. Consider what if your holiday is coming on weekends.
Please find the DDL for practice:-
create table order_details (id integer, start_date date,end_date date);
insert into order_details values (1,'2022-Dec-30','2023-Jan-05');
insert into order_details values (2,'2023-Jan-03','2023-Jan-05');
insert into order_details values (3,'2023-Jan-03','2023-Jan-13');
insert into order_details values (4,'2023-Jan-03','2023-Jan-31');
create table holiday_details (holidaye_name varchar(20), holiday_date date);
insert into holiday_details values ('New year','2023-Jan-01');
insert into holiday_details values ('Republic Day','2023-Jan-26');
insert into holiday_details values ('Holiday_0','2023-Jan-06');
insert into holiday_details values ('Holiday_1','2023-Jan-18');
Please find the link of my all previous videos:-
#aws S3-IAM-Redshift | Copy data from S3 to Redshift and vice versa using IAM role & policy #amazon
• #aws S3-IAM-Redshift |...
#sql interview question How to achieve Organisational hierarchy using self join from one table | DE
• #sql interview questio...
#sql Count occurence of character in a string / Count occurrence of word in a sentence #data analyst
• #sql Count occurence o...
#sql - difference between WHERE & AND clause with LEFT/RIGHT join | INNER join+WHERE=LEFT join+WHERE
Link • #sql - difference betw...
#sql How to handle NULL while aggregation | SUM() | AVG() | Data Analyst | Data Engineer |Math calc
• #sql How to handle NUL...
#sql Calculate start & end time and average time spent in successful transaction | startup interview
Link • #sql Calculate start &...
#sql to achieve last NOT NULL value from the record | Analytical Function | Data Engg | Data Analyst
Link • #sql to achieve last N...
#sql to identify Top Performing Product every Quarter of each year | Highest sale every quarter
Link • #sql to identify Top P...
#sql Interview Question - Calculate Running Total | Cumulative sum | UNBOUNDED PRECEDING FOLLOWING
Link • #sql Interview Questio...
#sql Interview question - Schedule cricket match between teams and generate points table using SQL
Link lnkd.in/dsM8Pe8B
#sql Interview Questions - All JOINS (INNER, LEFT, RIGHT, FULL OUTER) | JOIN only NULL values
Link lnkd.in/dJttWQBB
#sql Interview Question - What is the difference between COUNT(*), COUNT(1) and COUNT(-1)
Link lnkd.in/dVHMWxKj
#SQL Interview Question - How to delete duplicate record from table
Link lnkd.in/dcVyhC7X
#SQL Interview Question -Second highest salary using dense rank analytical function
Link lnkd.in/daBumQfB
#SQL to pull unique record after combination of column
#SELFJOIN
Link lnkd.in/d6tXYXCv
#SQL Join on duplicate values all four joins (INNER, LEFT, RIGHT, FULL OUTER)
Link lnkd.in/d9HcwkZs
#dataengineering #etl #dataanalysts #dataanalysis #bigdata #business
20 авг 2024