创建oracle实战演练

create table userinfomation(
uuid number(8)primary key,
uname varchar2(50)not null,
upwd varchar2(20)not null,
urealname varchar2(50)not null
)

create sequence userinfomation_seq;
insert into  userinfomation values(userinfomation_seq.nextval,'yz','123','可可');

select * from userinfomation;

create table fsort(
sid number(8) primary key,
sname varchar2(20)not null,
sremark varchar2(200)not null
)

create sequence fsort_seq;
select * from fsort;
insert into fsort values(fsort_seq.nextval,'爱情片','爱情电影指的是那些中心剧情主要围绕着故事主角恋爱关系发展的电影。');

create table fiml(
fid number(8) primary key,
sid number(8) not null references fsort(sid),
fname varchar2(50)not null,
fauto varchar2(200)not null,
ontime varchar2(20)not null,
fremark varchar2(200)not null,
fflag number(1)check(fflag in (0,1))
)

select * from fiml;


create sequence fiml_seq;

insert into fiml values(fiml_seq.nextval,'2','泰坦尼克号','小李子','2010','影片以1912年泰坦尼克游轮在其处女航时触礁冰山沉没事件为背景','1');
//alter table fiml add constraint fk_one foreign key(sid) references fsort(sid)

create table hall(
Tid number(8) primary key,
tname varchar2(50) not null,
tcount number(8) not null
)

create sequence hall_seq;

insert into hall values(hall_seq.nextval,'一楼放映大厅01','50');

select* from hall;

create table empfilm(
eid number(8) primary key,
ename varchar2(50)not null,
esex number(1) check (esex in(1,2)),
egw varchar2(50)not null
)
create sequence empfilm_seq;

insert into empfilm values(empfilm_seq.nextval,'张三','1','售票员');
insert into empfilm values(empfilm_seq.nextval,'思思','2','门迎');

create table broad(
xid number(8) primary key,
fid number(8)not null references fiml(fid),
tid  number(8)not null references hall(tid),
Eid  number(8)not null references empfilm(eid),
begintime varchar2(20)not null,
Endtime varchar2(20)not null,
xmoney float not null
)
create sequence broad_seq;
select * from broad;
create table sale(
mid number(8) primary key,
xid number(8)not null references broad(xid),
Mzw number(8)not null
)

create sequence sale_seq;



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值