summaryrefslogtreecommitdiff
path: root/task4_requests.sql
diff options
context:
space:
mode:
Diffstat (limited to 'task4_requests.sql')
-rw-r--r--task4_requests.sql10
1 files changed, 6 insertions, 4 deletions
diff --git a/task4_requests.sql b/task4_requests.sql
index c364b95..71e2fbe 100644
--- a/task4_requests.sql
+++ b/task4_requests.sql
@@ -2,11 +2,12 @@
-- Кластерный индекс --
-----------------------
-SELECT amount FROM Payments WHERE order_id=12412;
+SELECT * INTO Customers_copy FROM Customers
+GO
-CREATE CLUSTERED INDEX Payments_Clustered ON Payments (order_id);
+SELECT * FROM Customers WHERE id=12345;
GO
-DROP INDEX Payments_Clustered ON Payments;
+SELECT * FROM Customers_copy WHERE id=12345;
GO
--------------------------
@@ -69,7 +70,8 @@ GO
SELECT SUM(amount) FROM Payments WHERE date >= '2021-12-01';
-CREATE INDEX Payments_Filtered ON Payments (amount) WHERE date >= '2021-12-01';
+CREATE INDEX Payments_Filtered ON Payments (amount)
+ WHERE date >= '2021-12-01';
GO
DROP INDEX Payments_Filtered ON Payments;
GO