Difference between S-R flip flop and D flip flop
A D-flip flop basically stores the value for one clock cycle (and functions as a buffer, a chip enable pin will let you store for multiple clock cycles).

Table 1. The truth table for D flip-flop

+---+---+------------+-------------+
| c | D | Output     | Function    |
+---+---+------------+-------------+
|   | x | No change  | Store       |
+---+---+------------+-------------+
| ↑ | 1 | 1          | Transparent |
+---+---+------------+-------------+
| ↑ | 0 | 0          | Transparent |
+---+---+------------+-------------+


An SR flip flop is like a light switch. Set turns it 'on' and reset turns it 'off'

Table 2. The truth table for SR flip-flop 

+-----+---+---+------------+-----------+
| clk | S | R | Output     | Function  |
+-----+---+---+------------+-----------+
|     | x | x | no change  | Store     |
+-----+---+---+------------+-----------+
| ↑   | 0 | 0 | no change  | Store     |
+-----+---+---+------------+-----------+
| ↑   | 1 | 0 | 1          | Set       |
+-----+---+---+------------+-----------+
| ↑   | 0 | 1 | 0          | Reset     |
+-----+---+---+------------+-----------+
| ↑   | 1 | 1 | ?          | Undefined |
+-----+---+---+------------+-----------+