-
-
Save prodevo/368166da20e0f34b67b0e26b3293e574 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE Store | |
SELECT Product.name, Category.name | |
FROM Product | |
INNER JOIN Category ON Product.id_category = Category.id | |
INNER JOIN Delivery ON Delivery.id_product = Product.id | |
INNER JOIN Supplier ON Delivery.id_supplier = Supplier.id | |
WHERE Supplier.name = 'Везе Тобі Все' OR Supplier.name = 'Бусік Пандори' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE Store | |
SELECT Product.name AS 'name', Supplier.name AS 'supplier', Producer.name AS 'Producer', Category.name AS 'Category' | |
FROM Product | |
INNER JOIN Producer ON Product.id_producer = Producer.id | |
INNER JOIN Delivery ON Delivery.id_product = Product.id | |
INNER JOIN Supplier ON Delivery.id_supplier = Supplier.id | |
INNER JOIN Category ON Product.id_category = Category.id | |
WHERE Producer.name NOT LIKE '%A%' AND Producer.name NOT LIKE '%K%' AND Producer.name NOT LIKE '%M%' AND Category.name NOT LIKE 'Крупи'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE Store | |
SELECT Product.name AS 'produser' , Category.name AS 'category', Sale.quantity AS 'sales', Supplier.name AS 'supplier', Producer.name AS 'producer' | |
FROM Product | |
INNER JOIN Category ON Product.id_category = Category.id | |
INNER JOIN Sale ON Sale.id_product = Product.id | |
INNER JOIN Delivery ON Delivery.id_product = Product.id | |
INNER JOIN Supplier ON Delivery.id_supplier = Supplier.id | |
INNER JOIN Producer ON Product.id_producer = Producer.id | |
WHERE (Category.name = 'Молочна продукція' OR Category.name = 'Овочі') AND Sale.quantity > 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE Store | |
SELECT Product.name AS 'name', Supplier.name AS 'suplier', Category.name AS 'category', Delivery.date_of_delivery AS 'date', | |
(Delivery.price * Delivery.quantity) AS 'total price' | |
FROM Product | |
INNER JOIN Category ON Product.id_category = Category.id | |
INNER JOIN Delivery ON Delivery.id_product = Product.id | |
INNER JOIN Supplier ON Delivery.id_supplier = Supplier.id | |
WHERE Supplier.name IN ('Господарка Навиїзді', 'Везе Тобі Все', 'Східний Аромат') | |
ORDER BY Product.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment