-
-
Save prodevo/89fccc8a286023b4413d10c23cf87fb9 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 ATB | |
SELECT name,(price - (price * discount) / 100) * quantity AS [Можливий заробіток] | |
From Product | |
WHERE (name LIKE 'Хліб%' OR 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 ATB | |
UPDATE Product | |
SET price = ROUND(price * 0.95, 2) | |
SELECT * | |
From Product |
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 ATB | |
UPDATE Product | |
SET date_of_delivery = GETDATE() | |
WHERE date_of_delivery IS NULL | |
SELECT * | |
From Product |
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
DELETE FROM Product WHERE quantity < 100 AND price > 70; | |
SELECT * | |
FROM Product |
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
DELETE FROM Product WHERE category = 'Фрукти' AND category = 'М’ясні продукти'; | |
SELECT * | |
FROM Product |
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
SELECT * | |
FROM Product | |
DELETE FROM Product | |
WHERE LEN(name) = 5 |
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
SELECT * | |
FROM Product | |
DELETE FROM Product | |
WHERE date_of_delivery > DATEADD(MONTH, -3, '2025-06-03') |
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
SELECT TOP 5 * | |
FROM Product | |
ORDER BY price DESC |
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
DELETE FROM Product WHERE producer IS NULL OR discount > 10; | |
SELECT * | |
FROM Product |
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 ATB | |
SELECT name, date_of_delivery, quantity | |
From Product | |
--WHERE (name LIKE 'Хліб%' OR name = 'Молоко') | |
WHERE quantity > 10 AND date_of_delivery = DATEADD(DAY, -1, '2025-06-03') |
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 ATB | |
SELECT name, date_of_delivery, price | |
From Product | |
WHERE date_of_delivery > DATEADD(DAY, -30, '2025-06-03') |
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 ATB | |
SELECT * | |
From Product | |
WHERE name LIKE 'К%' AND category 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 ATB | |
SELECT * | |
From Product | |
WHERE name 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 ATB | |
SELECT name, date_of_delivery, price | |
From Product | |
WHERE date_of_delivery = DATEADD(WEEK, -1, '2025-06-03') | |
AND price < 50 |
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 ATB | |
SELECT category, quantity | |
From Product | |
WHERE category = 'Овочі' AND quantity > 25 --P.S категорії "безалкогольні напої немає" |
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 ATB | |
SELECT * | |
From Product | |
WHERE price >= 100 AND price <= 200 | |
ORDER BY price |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment