插入完整的行:
INSERT INTO Customers(cust_id,
cust_name,
cust_address,
cust_city,
cust_state,
cust_zip,
cust_country,
cust_contact,
cust_email)
VALUES('1000000006',
'Toy Land',
'123 Any Street',
'New York',
'NY',
'11111',
'USA',
NULL,
NULL);
插入部分行:
INSERT INTO Customers(cust_id,
cust_name,
cust_address,
cust_city,
cust_state,
cust_zip,
cust_country)
VALUES('1000000006',
'Toy Land',
'123 Any Street',
'New York',
'NY',
'11111',
'USA');
插入检索出的数据:
INSERT INTO Customers(cust_id,
cust_name,
cust_address,
cust_city,
cust_state,
cust_zip,
cust_country)
SELECT cust_id,
cust_name,
cust_address,
cust_city,
cust_state,
cust_zip,
cust_country
FROM CustNew;
从一个表复制到另一个表:
CREATE TABLE CustCopy AS
SELECT * FROM Customers;
更新数据:
UPDATE Customers
WHERE cust_id = '1000000005';
UPDATE Customers
SET cust_contact = 'Sam Roberts',
WHERE cust_id = '1000000006';
UPDATE Customers
SET cust_email = NULL -- 删除某个列
WHERE cust_id = '1000000005';
删除数据:
DELETE FROM Customers
WHERE cust_id = '1000000006';