2018/08/27--mysql数据库

INSERT INTO customers
VALUES(
NULL,
'Pep E. LaPew',
'100 Main Street',
'Los Angeles',
'CA',
'90046',
'USA',
NULL,
NULL
);


INSERT INTO customers(cust_name,cust_address,cust_city,cust_state,cust_zip,cust_country,cust_contact,cust_email)
VALUES
("Pep E. LaPew",'100 Main Street','Los Angeles','CA','90046','USA',NULL,NULL);

INSERT INTO customers(cust_name,cust_contact,cust_email,cust_address,cust_city,cust_state,cust_zip,cust_country)
VALUES
("Pep E. LaPew",NULL,NULL,'100 Main Street','Los Angeles','CA','90046','USA');

INSERT LOW_PRIORITY INTO customers
(cust_name,cust_address,cust_city,cust_state,cust_zip,cust_country,cust_contact,cust_email)
VALUES
('Pep E. LaPew','100 Main Street','Los Angeles','CA','90046','USA',NULL,NULL);

INSERT INTO customers(cust_name,cust_address,cust_city,cust_state,cust_zip,cust_country)
VALUES
("Pep E. LaPew",'100 Main Street','Los Angeles','CA','90046','USA');
INSERT INTO customers(cust_name,cust_address,cust_city,cust_state,cust_zip,cust_country)
VALUES
('M. Martin','42 Galaxy Way','New York','NY','11213','USA');

INSERT INTO customers(cust_name,cust_address,cust_city,cust_state,cust_zip,cust_country)
VALUES
('Pep E. LaPew','100 Main Street','Los Angeles','CA','90046','USA'),
('M. Martin','42 Galaxy Way','New York','NY','11213','USA');

INSERT INTO customers(cust_id,cust_name) SELECT cust_id,cust_name FROM custnew;

CREATE TABLE custnew(
cust_id int(11) NOT NULL AUTO_INCREMENT,
cust_name char(50) NOT NULL,
cust_address char(50) DEFAULT NULL,
cust_city char(50) DEFAULT NULL,
cust_state char(5) DEFAULT NULL,
cust_zip char(10) DEFAULT NULL,
cust_country char(50) DEFAULT NULL,
cust_contact char(50) DEFAULT NULL,
cust_email char(255) DEFAULT NULL,
PRIMARY KEY(cust_id) 
);

INSERT INTO custnew
(cust_name)
VALUES
('zhangshan');

猜你喜欢

转载自blog.csdn.net/qzw752890913/article/details/82082010
今日推荐