一、表空间和用户的操作
-
sysdba账号下新建表空间sp_test,作为数据表空间
create tablespace sp_test datafile 'sp_test.dbf' size 1m;
-
sysdba账号下新建临时表空间tsp_test
create temporary tablespace tsp_test tempfile 'tsp_test' size 2m;
-
drop user user_test;
-
新建用户user_test并指定它的数据表空间和临时表空间
create user user_test identified by user_test default tablespace sp_test temporary tablespace tsp_test;
-
删除用户user_test
drop user user_test;
-
删除sp_test,tsp_test
drop tablespace sp_test including contents and datafiles;
drop tablespace tsp_test including contents and datafiles;
二、SQL语言的分类
-
DDL(Data Definition Language):数据定义语言
-
DML(Data Manipulation Language):数据操纵语言
-
DQL(Data Query Language):数据查询语言
-
TCL(Transaction Control Language):事务控制语言
-
DCL(Data Control Language):数据控制语言
三、数据类型number
-
number可以指定精度
-
number(5,2):总长为5,有三位整数,两位小数
-
number(5,-2):总长为7,有七位整数,没有小数,并且后两位为0
-
number如果不指定的话,总长默认位38位
四、char和varchar的区别
-
char长度是固定的,varchar的长度是变化的,如果实际数据内容不足列的宽度则只占用合适的空间来存放数据,会大大地节省数据库空间。
-
数据处理时,varchar更适合列比较大的,如果varchar(2)这样列比较小的就没有意义了,它反而还要花费额外的空间来记录该列的数据实际长度,数据库在处理varchar列时要进行额外的计算处理,并存储数据的实际长度,在效率上不如char性能高。
-