--DBMS 数据库管理系统
--sql server 的数据类型:int ,smallint ,char,varchar,nchar,nvarchar,ntext,datetime,smalldatetime,money,decima, --float,bit…… --oracle 的数据类型:number(p,s),char,varchar2,Date,LOB --注意:insert into table_name values('1','张三','男',date'2012-3-5');---插入字符串日期前加date转换类型
--sql server :getdate() --oracle:sysdate --例如:设定日期格式的函数:to_char(sysdate,'yyy-mm-dd');
--sql server 中添加默认约束:alter table talbe_name add DF_table_name default('男') for **; --oracle 中添加默认值:alter table table_name modify(** default('男'));
--sql server 中连接:使用“ ”连接,例如:print 'aaaa' @name; --oracle 中连接:使用“||”连接,例如:dbms_output.put_line('aaa'||name);---name为变量
--5.oracle没有identity自动增长列
而是使用序列实现增长 --sql server 自动增长:在表的主键列中可直接使用identity(1,1)实现增长 --oracle 使用序列自动增长: create sequence se_id start with 1 increment by 1 --使用序列实现自动增长:se_id.nextval
--sql server中: if 条件 begin ………… end else begin ………… end --oracle中: if 条件1 then …………; elsif 条件2 then …………; else …………; end if;
--sql server中: --select ....case.....(else)....end....语句 select stuno '学号',case when grade |