Created
May 5, 2023 15:38
-
-
Save ilfey/1b6607c5d7971e4d6aaa2ed3d6039ac6 to your computer and use it in GitHub Desktop.
4 лаба по ОПБД
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 Orders; | |
| INSERT INTO Customer(FirstName, LastName, Email, Phone) | |
| VALUES | |
| ('John', 'Doe', '[email protected]', '8-952-866-54-50'), | |
| ('Jane', 'Doe', '[email protected]', '8-952-866-54-51'), | |
| ('Bob', 'Smith', '[email protected]', '8-952-866-54-52'), | |
| ('Alice', 'Johnson', '[email protected]', '8-952-866-54-53'), | |
| ('Alex', 'Brown', '[email protected]', '8-952-866-54-54'), | |
| ('Olivia', 'Wilson', '[email protected]', '8-952-866-54-55'), | |
| ('Chris', 'Davis', '[email protected]', '8-952-866-54-56'); | |
| INSERT INTO product(productname, manufacturer, productcount, price) | |
| VALUES | |
| ('Samsung Galaxy S21', 'Samsung', 20, 79990.00), | |
| ('iPhone 12', 'Apple', 15, 99990.00), | |
| ('Google Pixel 5', 'Google', 10, 59990.00), | |
| ('OnePlus 9 Pro', 'OnePlus', 8, 74990.00), | |
| ('Xiaomi Mi 11', 'Xiaomi', 12, 66990.00), | |
| ('Sony Xperia 5 II', 'Sony', 5, 79990.00), | |
| ('Motorola Edge 20', 'Motorola', 15, 59990.00); | |
| INSERT INTO Orders (ProductId, CustomerId, OrderDate, ProductCount) | |
| VALUES | |
| (5, 7, '2023-05-05', 1), | |
| (10, 11, '2023-05-05', NULL), | |
| (12, 9, '2023-05-05', 1), | |
| (3, 2, '2023-05-05', 1), | |
| (8, 4, '2023-05-05', 1), | |
| (11, 8, '2023-05-05', NULL), | |
| (6, 6, '2023-05-05', 2), | |
| (9, 1, '2023-05-05', 1), | |
| (7, 13, '2023-05-05', NULL), | |
| (14, 5, '2023-05-05', 1), | |
| (1, 10, '2023-05-05', NULL), | |
| (16, 3, '2023-05-05', 1), | |
| (2, 12, '2023-05-05', 1), | |
| (4, 7, '2023-05-05', NULL), | |
| (15, 9, '2023-05-05', 2); | |
| UPDATE customer SET phone = 'номер телефона не указан' WHERE phone = 'нет данных'; | |
| UPDATE customer SET phone = '+79213508964' WHERE lower(firstname) = 'ivanov'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment