create database shop;
use shop
create table product(
product_id char(4) not null,
product_name varchar(100) not null,
product_type varchar(32) not null,
sale_price integer,
purchase_price integer,
regist_date date,
primary key(product_id));
alter table product add column product_name_pinyin varchar(100);
alter table product drop culumn product_name_pinyin;
INSERT INTO productins VALUES (‘0002’, ‘打孔器’,
‘办公用品’, 500, 320, ‘2009-09-11’);
INSERT INTO productins VALUES (‘0003’, ‘运动T恤’,
‘衣服’, 4000, 2800, NULL);
INSERT INTO productins VALUES (‘0004’, ‘菜刀’,
‘厨房用具’, 3000, 2800, ‘2009-09-20’);
– 多行INSERT ( DB2、SQL、SQL Server、 PostgreSQL 和 MySQL多行插入)
INSERT INTO productins VALUES (‘0002’, ‘打孔器’,
‘办公用品’, 500, 320, ‘2009-09-11’),
(‘0003’, ‘运动T恤’, ‘衣服’, 4000, 2800, NULL),
(‘0007’, ‘菜刀’, ‘厨房用具’, 3000, 2800, ‘2009-09-20’);
– Oracle中的多行INSERT
INSERT ALL INTO productins VALUES (‘0002’, ‘打孔器’, ‘办公用品’, 500, 320, ‘2009-09-11’)
INTO productins VALUES (‘0003’, ‘运动T恤’, ‘衣服’, 4000, 2800, NULL)
INTO productins VALUES (‘0004’, ‘菜刀’, ‘厨房用具’, 3000, 2800, ‘2009-09-20’)
SELECT * FROM DUAL;
delete from productins where productins_id==‘0001’;