create table customer(
"客户编号" number(8),
"客户名称" varchar2(40),
"客户电话" varchar2(20)
)
(2)
insert into customer values(1,'客户1','13900000001')
insert into customer values(2,'客户2','13900000002')
insert into customer values(3,'客户3','13900000003')
insert into customer values(4,'客户4','13900000004')
insert into customer values(5,'客户5','13900000005')
insert into customer values(6,'客户6','13900000006')
insert into customer values(7,'客户7','13900000007')
insert into customer values(8,'客户8','13900000008')
insert into customer values(9,'客户9','13900000009')
insert into customer values(10,'客户10','13900000010')
(3)
select * from customer where rownum>=4 and rownum<=6
SQL>create table goods(goodsId char(8) primary key, --主键 goodsName varchar2(30), unitprice number(10,2) check(unitprice>0), category varchar2(8), provider varchar2(30) )SQL>create table customer( customerId char(8) primary key, --主键 name varchar2(50) not null, --不为空 address varchar2(50), email varchar2(50) unique, sex char(2) default '男' check(sex in ('男','女')), -- 一个char能存半个汉字,两位char能存一个汉字 cardId char(18) )SQL>create table purchase( customerId char(8) references customer(customerId), goodsId char(8) references goods(goodsId), nums number(10) check (nums between 1 and 30) )希望对你有所帮助~
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)