title: Check for time coverage for each specific type in SQL Server
body: <p>Suppose I have the following data tables in SQL :</p>
  
  <pre><code>  **TimeRange**
  
    StartTime   -   EndTime   -   Type
    ----------------------------------
    00:00       -   01:45     -   A
    01:50       -   03:30     -   A
    03:35       -   03:40     -   A
    03:45       -   13:15     -   A
    13:20       -   19:25     -   A
    19:30       -   23:55     -   A
  
    00:00       -   02:50     -   B
    03:30       -   12:30     -   B
    12:35       -   13:40     -   B
    13:45       -   18:15     -   B
    18:20       -   19:25     -   B
    21:00       -   23:55     -   B
  
    00:00       -   11:55     -   C
  
    **Type**
  
    TypeID  -   Name 
    ----------------
    1       -   A 
    2       -   B
    3       -   C
  </code></pre>
  
  <p>Each type from <strong>Type</strong>  table should cover time range 00:00 - 23:55. Each StartTime = previous EndTime + 5. We should select the rows that doesn't have coverage. In the mentioned example the following should be selected out :</p>
  
  <pre><code> Output:
   StartTime  EndTime Type
   ------------------------
   02:55      03:25    B
   19:30      20:55    B
   12:00      23:55    C
  </code></pre>
  
  <p>Can you please help me in writing corresponding query for this purpose?</p>
  
  <p>Thanks in advance !</p>