【雪野实训记录】Oracle数据库 T1作业——Oracle入门

前端之家收集整理的这篇文章主要介绍了【雪野实训记录】Oracle数据库 T1作业——Oracle入门前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
--Oracle 入门 作业-- --创建一个名为DAVID的用户,口令为davidpass-- --并授予其连接数据库和创建表对象的权限。-- --同时授予其访问另一用户MARTIN的表TEST的权限.-- create user DAVID identified by davidpass; grant connect to DAVID; grant select on MAERIN.TEST to DAVID; --bbsUsers用户表,存储注册用户信息,用户注册后才能发贴和回贴-- --bbsTopic主贴表,存储主贴的内容-- --bbsReply跟贴表,存储跟贴的内容-- --bbsSection存储版块的信息-- create sequence bbs_seq increment by 1 start with 1 maxvalue 999999999 nocycle cache 10; create table bbsUsers( uuid int primary key not null,upwd varchar2(20) default '888888' check(length(upwd)>=6),usex char(1) default '1',urdate date default sysdate,ustate int default 0 not null,ujb int default 1 not null,ujf number default 20,uemail varchar2(30) check(uemail like '%@%') ); create table bbsSection( sid int primary key not null,sname varchar2(32) not null,smasterID int references bbsUsers(uuid),sprofile varchar2(20),sclickCount int,stopicCount int ); create table bbsTopic( tid int primary key not null,tsid int references bbsSection(sid),tuid int references bbsUsers(uuid),treplyCount int,tface int,ttopic varchar2(20) not null,tcontents varchar2(30) not null,ttime date,tclickCount int,tstate int not null,tlastReply date ); create table bbsReply( rid int primary key not null,rtid references bbsTopic(tid),rsid references bbsSection(sid),ruid references bbsUsers(uuid),rface int,rcontents varchar2(20) check (length(rcontents)>6) not null,rtime date,rclickCount int ); select * from bbsusers; select * from bbsTopic; select * from bbsReply; select * from bbsSection; drop table bbsTopic; drop table bbsReply; drop table bbsSection; drop table bbsusers;

猜你在找的Oracle相关文章