Skip to content

Instantly share code, notes, and snippets.

@Arsenii123
Created December 21, 2025 20:20
Show Gist options
  • Select an option

  • Save Arsenii123/c6c1641393411ea52ec56bffcb7509ce to your computer and use it in GitHub Desktop.

Select an option

Save Arsenii123/c6c1641393411ea52ec56bffcb7509ce to your computer and use it in GitHub Desktop.
Запити
--1
SELECT *,(price-price*discount/100)*quantity AS [Overall]
FROM Product
WHERE category LIKE N'продукти'
--2
SELECT *
FROM Product
WHERE DATEDIFF(DAY,GETDATE(),date_of_delivery)>=10
--3
SELECT *
FROM Product
WHERE DATEDIFF(MONTH,GETDATE(),date_of_delivery)=0
--4
SELECT *
FROM Product
WHERE category LIKE N'Кондитерські вироби'
--5
SELECT *
FROM Product
WHERE category LIKE N'%А' AND name LIKE N'%К'
--6
SELECT *
FROM Product
WHERE name LIKE N'%[В-Л]'
--7
SELECT *
FROM Product
WHERE DATEDIFF( WEEK,GETDATE(),date_of_delivery)=1 AND price<50
--8
SELECT *
FROM Product
WHERE category LIKE N'напої' AND quantity>100
--9
SELECT *
FROM Product
WHERE price>=100 AND price<200
ORDER BY price ASC
--10
UPDATE Product
SET price=price-price*5/100
SELECT *
FROM Product
--11
SELECT *
FROM Product
WHERE date_of_delivery IS NULL
UPDATE Product
SET date_of_delivery=GETDATE()
--12
DELETE FROM Product
WHERE quantity<100 AND price>70
SELECT *
FROM Product
--13
SELECT *
FROM Product
WHERE category LIKE N'напої' AND quantity>100 OR category LIKE N'Кондитерськи вироби'
--14 -
--15 -
--16
DELETE FROM Product
WHERE DATEDIFF(MONTH,GETDATE(),date_of_delivery)>3
SELECT *
FROM Product
--17
SELECT TOP 5 price
FROM Product
--18
DELETE FROM Product
WHERE producer IS NULL OR discount>10
SELECT *
FROM Product
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment