5 kyu

Count Weekdays

1,493 of 1,496pmatseykanets

Description:

You need to create a function that calculates the number of weekdays (Monday through Friday) between two dates inclusively.

The function should be named weekdays accept two arguments of type DATE and return an INTEGER value.

weekdays(DATE, DATE) INTEGER

The order of arguments shouldn't matter. To illustrate both of the following queries

SELECT weekdays('2016-01-01', '2016-01-10');
SELECT weekdays('2016-01-10', '2016-01-01');

should produce the same result

 weekdays
----------
        6
(1 row)
SQL
Fundamentals
Databases

Stats:

CreatedNov 10, 2016
PublishedNov 10, 2016
Warriors Trained6734
Total Skips2230
Total Code Submissions30498
Total Times Completed1496
SQL Completions1493
Total Stars130
% of votes with a positive feedback rating87% of 220
Total "Very Satisfied" Votes178
Total "Somewhat Satisfied" Votes27
Total "Not Satisfied" Votes15
Total Rank Assessments10
Average Assessed Rank
5 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
6 kyu
Ad
Contributors
  • pmatseykanets Avatar
  • Unnamed Avatar
  • smile67 Avatar
Ad