DML Flashcards
1
Q
INSERT
VALUES
A
INSERT dataset.Inventory (product, quantity) VALUES('top load washer', 10), ('front load washer', 20), ('dryer', 30), ('refrigerator', 10), ('microwave', 20), ('dishwasher', 30), ('oven', 5)
2
Q
INSERT SELECT
A
INSERT dataset.Warehouse (warehouse, state) SELECT * FROM UNNEST([('warehouse #1', 'WA'), ('warehouse #2', 'CA'), ('warehouse #3', 'WA')])
3
Q
열 이름이 없는 INSERT
A
INSERT dataset.Warehouse
VALUES(‘warehouse #4’, ‘WA’), (‘warehouse #5’, ‘NY’)
4
Q
DELETE 문
A
DELETE dataset.Inventory
WHERE quantity = 0
5
Q
서브 쿼리가 포함된 DELETE
A
DELETE dataset.Inventory i
WHERE i.product NOT IN (
SELECT product from dataset.NewArrivals)
6
Q
TRUNCATE TABLE
A
TRUNCATE TABLE dataset.Inventory
7
Q
UPDATE
A
UPDATE dataset.Inventory
SET quantity = quantity - 10
WHERE product like ‘%washer%’