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
Similar Kata:
Stats:
Created | Nov 10, 2016 |
Published | Nov 10, 2016 |
Warriors Trained | 6734 |
Total Skips | 2230 |
Total Code Submissions | 30498 |
Total Times Completed | 1496 |
SQL Completions | 1493 |
Total Stars | 130 |
% of votes with a positive feedback rating | 87% of 220 |
Total "Very Satisfied" Votes | 178 |
Total "Somewhat Satisfied" Votes | 27 |
Total "Not Satisfied" Votes | 15 |
Total Rank Assessments | 10 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 6 kyu |