Oracle DB: SQL_FIDDLE
It\'s about counting and the beginning of weekly periods:
Table_1 lists the plan and it\'s start date.
Table_2 lists periods and t