28.Which two statements are true regarding constraints?
2015-12-18 11:46
627 查看
28.Which two statements are true regarding constraints?
A.A foreign key cannot contain NULL values.
B.A column with the UNIQUE constraint can contain NULL values.
C.A constraint is enforced only for the INSERT operation on a table.
D.A constraint can be disabled even if the constraint column contains data.
E.All constraints can be defined at the column level as well as the table level.
答案:BD
A:错误
B:正确
A.A foreign key cannot contain NULL values.
B.A column with the UNIQUE constraint can contain NULL values.
C.A constraint is enforced only for the INSERT operation on a table.
D.A constraint can be disabled even if the constraint column contains data.
E.All constraints can be defined at the column level as well as the table level.
答案:BD
A:错误
create table test1(a number constraint un_a unique); insert into test1 values(1); commit; create table test2 (a number,constraint fk_a foreign key(a) references test1(a)); insert into test2 values(null); commit;--可以有null
B:正确
insert into test1 values(null);1.NOT NULL
create table test1 (a number constraint nu_a not null); create table test2 (a number constraint nu_a null);2.unique
create table test1 (a number constraint un_q unique); create table test2 (a number, constraint un_q unique(a));3.primary key
create table test1 (a number constraint pk_a primary key); create table test2 (a number, constraint pk_a primary key(a));4.foreign key
create table test1 (a number constraint pk_a primary key); create table test2 (a number constraint fk_a references test1(a)); create table test3 (a number, constraint fk_a foreign key(a) references test1(a));5.check
create table test1 (a number constraint ck_a check(a<3)); create table test1 (a number,constraint ck_a check(a<3));5.REF:可以定义在列和表上,下面是个简单例子,这里其实又分3种
create type type_test as object(a number); create table type_table_test of type_test; create table type_table_ref (a number,b ref type_test scope is type_table_test);
相关文章推荐
- requirejs+anjularjs+express框架
- UIAlertController的一些简单实用方法
- 【转】特殊权限控制之SUID、SGID、Sticky
- PowerBuild利用timing实现同时使用多个定时器
- SQL Server中字符串转化为GUID的标量函数实现
- Duilib界面布局文件XML学习-XML文件简介
- UICollectionView 运用
- processing - MySQL example1-conntction(), query() , next() , getInt(1)
- [转]无需看到你的脸就能认出你——实现Beyond Frontal Faces: Improving Person Recognition Using Multiple Cues
- iOS7/8 UIButton高亮状态延迟问题全解
- Java中parse()和valueOf(),toString()的区别
- SQLiteDatabase query 和 rawQuery 的区别
- IOS UITextField 去除字符串首位空格和换行 设置清除按钮显示模式
- Rescue
- Request&Response编程
- protocol isis issues(续1.3----buffer_size相关)
- Java中String、StringBuilder和StringBuffer的简单区别
- 关于SearchView中onQueryTextSubmit方法执行两次的解决方法
- 用系统的TabBar不让系统渲染图片设置文字背影颜色
- 同步辅助类-DelayQueue队列研究