I have this code and its temporary tables so you can run it.

```
create table #Category(
id int identity(1,1),
name varchar(50)
)

create table #Items(
id int identity(1,1),
name varchar(50),
category_id int,
price decimal(18,2)
)

create table #Order(
id int identity(1,1),
item_id int,
quantity int,
isactive tinyint
)

insert into #Category(name)
values('Breakfast'),('Lunch'),('Dinner')

insert into #Items(name,category_id,price)
values('Sandwich w/ Egg',1,20),('Sandwich w/ Hotdog',1,35),('Fried Chicken',2,50),('Salad',3,100)

insert into #Order(item_id,quantity,isactive)
values(1,2,1),(1,1,0),(2,4,1),(4,1,1)

drop table #Category
drop table #Items
drop table #Order

```

This will give you this output 

```
id          name        quantity         total
----------------------------------------------
1           Breakfast     3              60.00 
1           Breakfast     4              140.00 
2           Lunch         NULL           NULL
3           Dinner        1              100.00

```

I wanted to have the breakfast all together same with lunch and dinner

My goal:

```
id          name        quantity         total
----------------------------------------------
1           Breakfast     7              200.00 
2           Lunch         NULL           NULL
3           Dinner        1              100.00

```

My attempt:

```
select
C.id,
C.name,
sum(O.quantity) 'quantity',
sum(o.quantity) * I.price 'total'
from #Category C
left join #Items I
on I.category_id = C.id
left join #Order O
on O.item_id = I.id
group by C.id, C.name, I.price

```

This is all I got for you I need your help.