summaryrefslogtreecommitdiff
path: root/task5_views.sql
diff options
context:
space:
mode:
Diffstat (limited to 'task5_views.sql')
-rw-r--r--task5_views.sql20
1 files changed, 20 insertions, 0 deletions
diff --git a/task5_views.sql b/task5_views.sql
index 87d1ea3..15032de 100644
--- a/task5_views.sql
+++ b/task5_views.sql
@@ -56,6 +56,26 @@ GO
-- Задание 2 --
---------------
+CREATE VIEW BoxesView AS
+SELECT * FROM Boxes
+WHERE weight < 25 AND volume <= 1.1
+WITH CHECK OPTION
+GO
+
+DROP VIEW BoxesView
+GO
+
+INSERT INTO BoxesView (order_id, warehouse_id, wrapping_id, volume, weight)
+VALUES (1, 1, 1, 0.7, 13)
+GO
+
+INSERT INTO BoxesView (order_id, warehouse_id, wrapping_id, volume, weight)
+VALUES (1, 1, 1, 1.7, 13)
+GO
+
+INSERT INTO BoxesView (order_id, warehouse_id, wrapping_id, volume, weight)
+VALUES (1, 1, 1, 0.5, 27)
+GO
---------------
-- Задание 3 --