Skip to content

Instantly share code, notes, and snippets.

@FromMeloriWithLove
Last active May 30, 2023 09:48
Show Gist options
  • Save FromMeloriWithLove/035a77316abdc49ad4fbd83c9929f475 to your computer and use it in GitHub Desktop.
Save FromMeloriWithLove/035a77316abdc49ad4fbd83c9929f475 to your computer and use it in GitHub Desktop.
1.
SELECT Product.name, Delivery.date_of_delivery, Supplier.name
FROM Product
JOIN Delivery ON Delivery.id = Product.id_producer
JOIN Supplier ON Supplier.id = Delivery.id_supplier
2.
SELECT Region.name
FROM Region
EXCEPT
SELECT Region.name
FROM Region
WHERE Region.name is NULL
3.
SELECT Category.name
FROM Category
EXCEPT
SELECT Category.name
FROM Category
WHERE Category.name LIKE 'Бакалея'
4.
SELECT name
FROM City
EXCEPT
SELECT ct.name
FROM Producer pr JOIN Product p
ON pr.id = p.id_producer
JOIN Category c ON c.id = p.id_category
JOIN Address a ON a.id = pr.id_address
JOIN City ct ON ct.id = a.id_city
WHERE c.name LIKE 'Молочные'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment