手记

4月9

--3.9创建客户表、产品表
--创建客户表


CREATe TABLE Customer

(Cusno nvarchar(3) not null,

CusName nvarchar(10) not null,

Address nvarchar(20) not null,

Tel nvarchar(20) not null)

GO 
select * from Customer

--创建产品表

CREATe TABLE Product

(ProNo nvarchar(5) not null,

ProName nvarchar(10) not null,

Price decimal (8,2) not null,

Stocks decimal(8,0) not null)

GO


select * from Customer

select * from Product

--向表中插入数据
insert Customer
VALUES ('001','杨婷','深圳','0755-22221111')
insert Customer
VALUES ('002','陈萍','深圳','075522223333')
insert Customer
VALUES ('003','李东','深圳','075522225555')
insert Customer
VALUES ('004','叶合','广东','0755-22227777')
insert Customer
VALUES ('005','谭新','广州','0755-22229999')

--向产品表插入数据
insert Product
VALUES('0001 ','电视','3000.00','800')
insert Product
VALUES('0002 ','空调','2000.00','500')
insert Product
VALUES('0003 ','床','1000.00','300')
insert Product
VALUES('0004 ','餐桌','1500.00','200')
insert Product
VALUES('0005 ','音响','5000.00','600')
insert Product
VALUES('0006 ','沙发','6000.00','100')

--删除表中一行数据
delete Customer 
from Customer 
WHERE Cusno ='003'
0人推荐
随时随地看视频
慕课网APP