I have a master table like this

```
+----------------------------------------------+
| id |  user_id  |   date     |  vehicle_type  |  
+----------------------------------------------+
| 1  |  1        | 2017-06-01 |       1        |
| 2  |  1        | 2017-06-01 |       2        |
| 3  |  1        | 2017-06-01 |       1        |
| 4  |  1        | 2017-06-02 |       2        |
| 5  |  1        | 2017-06-02 |       1        |
| 6  |  2        | 2017-06-01 |       2        |
| 7  |  2        | 2017-06-01 |       1        |
| 8  |  2        | 2017-06-01 |       2        |
| 9  |  2        | 2017-06-02 |       1        |
+----------------------------------------------+

```

I want to group by `user_id` and `date`, and sum the vehicle\_type depend on its value, and create as view.
here the output i want

```
+------------------------------------------------+-------------------+
| id |  user_id  |   date     |  vehicle_type_1  |   vehicle_type_2  |
+------------------------------------------------+-------------------+
| 1  |  1        | 2017-06-01 |       2          |          2        |
| 4  |  1        | 2017-06-02 |       1          |          1        |
| 6  |  2        | 2017-06-01 |       1          |          2        |
| 9  |  2        | 2017-06-02 |       1          |          0        |
+------------------------------------------------+-------------------+

```

the question is the best sql(query) to get output like i want.
Thanks,