删除 创建 授权用户信息
SQL > drop user wcj cascade ;
用户已删除。
SQL > create user wcj identified by wcj;
用户已创建。
SQL > grant connect , resource to wcj;
授权成功。
SQL > connect wcj/ wcj @orcl ;
SQL > alter session set nls_date_format= 'rrrr-mm-dd' ;
会话已更改。
SQL > select table_name from user_tables ;
desc table_name;
SQL > alter table TB_term rename column titleid to termid;
创建表
SQL > create table TB_teachingyear ( teachingyearid char ( 4 ) primary key , teachingyearname nchar ( 11 ) not null ) ;
表已创建。
SQL > create table TB_term ( titleid char ( 2 ) primary key , titlename char ( 8 ) not null ) ;
表已创建。
SQL > CREATE TABLE TB_Title
( TitleID CHAR ( 2 ) PRIMARY KEY ,
TitleName CHAR ( 8 ) NOT NULL
)
SQL > create table TB_dept ( deptid char ( 2 ) primary key , deptname char ( 20 ) not null , deptsetdate date not null , deptscript nchar ( 50 ) not null ) ;
表已创建。
SQL > CREATE TABLE TB_Spec
( SpecID CHAR ( 4 ) PRIMARY KEY ,
SpecName CHAR ( 20 ) NOT NULL ,
DeptID CHAR ( 2 ) NOT NULL REFERENCES TB_Dept( DeptID) ,
SpecScript TEXT NOT NULL
)
SQL > create table TB_teacher ( teacherid char ( 6 ) primary key