对日期数据的插入
insert into tabname(datecol) value(sysdate) ; -- 用date值
insert into tabname(datecol) value(sysdate+1) ; -- 用date值
insert into tabname(datecol) value(to_date('2014-02-14','yyyy-mm-dd')) ; -- 用to_date
insert into tabname(datecol) value(to_date('2014-02-14 20:47:00','yyyy-mm-dd hh24:mi:ss')) ; -- 用to_date
insert into tabname(datecol) value(to_date('20140214','yyyymmdd')) ; -- 用to_date
insert into tabname(datecol) value(to_date('20140214204700','yyyymmddhh24miss')) ; -- 用to_date
对表的操作——添加外键约束
语法:
alter table 表1-表名
add constraint 外键名称(一般外键名称为”fK_”开头) foreign key (要设为外键的列名)
references 表2-表名(与哪个表有关联) (表2中该列列名);
alter table T_Result
add constraint fk_studentId2 foreign key (studentId)
references T_Student (studentId);
alter table t_CardInfo
add constraint fk_customerID foreign key(customerid)
references T_UserInfo (customerid);