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;
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;