База данных автомагазина

SELECT magazine.id,lastname,marka,model,quantity, SUM(quantity) from client,marka,cars,magazine where id_lastname=client.id and id_car=cars.id and id_marka=marka_id group by model
idlastnamemarkamodelquantitySUM(quantity)
Диаграмма