SELECT Deliveries.id FROM data1!deliveries ;
WHERE Deliveries.cost=(SELECT MIN(Deliveries.cost) FROM data1!eat LEFT OUTER JOIN data1!deliveries ON Eat.deliver_id = Deliveries.id ;
WHERE Deliveries.product_id=products[i] AND Eat.animal_id=val(thisform.animal.value)) INTO ARRAY delivs
SELECT Animals.name as "Животное", Products.name as "Продукт", Suppliers.name as "Поставщик", Deliveries.cost as "Стоимость", Eat.amount as "Количество";
FROM data1!eat LEFT OUTER JOIN data1!deliveries ON Eat.deliver_id = Deliveries.id ;
LEFT OUTER JOIN data1!animals ON Eat.animal_id = Animals.id ;
LEFT OUTER JOIN data1!suppliers ON Deliveries.supplier_id = Suppliers.id ;
LEFT OUTER JOIN data1!products ON Deliveries.product_id = Products.id ;
WHERE Eat.animal_id=val(thisform.animal.value) AND ;
Deliveries.id = delivs[1] AND ;
Deliveries.cost < (COST_[1]/Eat.amount) ;
ORDER BY Animals.name, Products.name INTO CURSOR cur_tmp
SELECT temp
APPEND FROM DBF("cur_tmp")
if reccount() > 0
SELECT Deliveries.cost*Eat.amount;
FROM data1!eat LEFT OUTER JOIN data1!deliveries ON Eat.deliver_id = Deliveries.id ;
LEFT OUTER JOIN data1!products ON Deliveries.product_id = Products.id ;
WHERE Eat.animal_id=val(thisform.animal.value) AND ;
Deliveries.id = delivs[1];
INTO ARRAY tmp
COST_[1] = COST_[1] - tmp[1]
endif
ENDFOR
SELECT * FROM temp
DELETE FROM temp
PACK
Найти виды продуктов, поступающих для кормления животных (мясо, рыба, овощи и др.), отсортировать по наименованиям.
Код запроса:
SELECT Products.name as "Продукт", Suppliers.name as "Поставщик", Deliveries.cost as "Стоимость", Deliveries.date as "Дата_реализации";
FROM data1!deliveries LEFT OUTER JOIN data1!products ON Deliveries.product_id = Products.id;
LEFT OUTER JOIN data1!suppliers ON Deliveries.supplier_id = Suppliers.id;
ORDER BY Products.name
Найти виды продуктов, поступающих для кормления животных (мясо, рыба, овощи и др.), отсортировать по стоимости.
Код запроса:
SELECT Products.name as "Продукт", Suppliers.name as "Поставщик", Deliveries.cost as "Стоимость", Deliveries.date as "Дата_реализации";
FROM data1!deliveries LEFT OUTER JOIN data1!products ON Deliveries.product_id = Products.id;
LEFT OUTER JOIN data1!suppliers ON Deliveries.supplier_id = Suppliers.id;
ORDER BY Deliveries.cost
Найти виды продуктов, поступающих для кормления животных (мясо, рыба, овощи и др.), отсортировать по дате реализации.
Код запроса:
SELECT Products.name as "Продукт", Suppliers.name as "Поставщик", Deliveries.cost as "Стоимость", Deliveries.date as "Дата_реализации";
FROM data1!deliveries LEFT OUTER JOIN data1!products ON Deliveries.product_id = Products.id;
LEFT OUTER JOIN data1!suppliers ON Deliveries.supplier_id = Suppliers.id;
ORDER BY Deliveries.date
В процессе выполнения данной расчётно-графической работы были закреплены знания и навыки, полученные в ходе сдачи лабораторных работ, включающие в себя:
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.