The syntax for creating a view is really simple:
create view <view name> as
<select query here>;
The question that you have asked is for a view that returns exactly five columns. You can handle this with an aggregation query:
create view v_name as
select device_id,
sum(case when device_type = 'A' then count else 0 end) as a,
sum(case when device_type = 'B' then count else 0 end) as b,
sum(case when device_type = 'C' then count else 0 end) as c,
sum(case when device_type = 'D' then count else 0 end) as d
from t -- your table name here
group by device_id;
The caveat is that this returns exactly the types that are in the SELECT
-- no others if they are in the table. If you need flexible columns, then you have a problem. It is not hard to construct a dynamic query to return the values at any given time. However, you cannot put dynamic SQL in a view. If this is something you need, then some alternative mechanism -- such as JSON -- might be needed.