I have a table that looks like below

```
eventType.    deviceModel.    deviceType
received        S8             Samsung
success.        S8             Samsung
failure         S8             Samsung
.
.
.

      received = indicates that 'A' event was received
      Success =  indicates that 'A' event was processed successfully
      failure = indicates that 'A' event failed to process

```

I want to aggregate this data and calculate the % of failure for the deviceType and deviceModel combination. 

Essentially I need first count all the entries with eventType "received" for a particular deviceModel and deviceType. 

Then count the all the entries with eventType "success" for same deviceModel and deviceType combination and then calculate % of (total of received - total of success)/total of time \* 100.

How can I do this using a SQL query?

I expect the output like

```
 deviceType.     deviceModel.       Failure %
 samsung         S8                  10%

```