Oracle表管理-----怎么样创建表-------------------------------------------------------建表 学生表 sqlgt;create table
oracle表管理-----怎么样创建表
-------------------------------------------------------
建表
学生表
sql>create table student(
xh number(4),--学号
xm varchar2(20),---姓名
sex char(2),---性别
birthday date,---出生日期
sal number(7,2),----奖学金
);
---------------------------------------------------------
表修改
添加一个字段
sql>alter table student add(classid number(2));
修改字段的长度
sql>alter table student modify (xm varchar2(30));
删除一个字段
sql>alter table student drop column sal;
修改表的名字
sql>rename student to stu
删除表
sql>drop table student;
---------------------------------------------------------
添加数据
Oracle中的默认日期格式‘DD-MON-YY’dd 日子(天) mon 是月
份 yy是2位的年
改日期的默认格式:
alter seesion set nls_date_format = 'yyyy-mm-dd'
==========================================================
当你在数据库中插入了null值的数据的时候,你想根据这些null来
把这个数据查出来
错误的:select * from student where birthday='';
正确的是:select * from student where birthday is null;
这是Oracle和其它数据库之间不一样的地方 请牢记
select * from student where birthday is not null;

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号