You want to create a table employees in which the values of columns EMPLOYEES_ID and
LOGIN_ID must be unique and not null. Which two SQL statements would create the
required table?
A.
Option A
B.
Option B
C.
Option C
D.
Option D
E.
Option E
F.
Option F
D is wrong.
Not null can only define on column level not table level.
A, E
A: PRIMARY KEY is combination of unique and not-null.
E :NOT NULL and unique constraint is present
D is wrong as not null constraint cannot be provided at table level.
D is wrong
D and E is correct
create table PERSONASYS.PRUEBA003
(
nombre NUMBER constraint nn_notnull not null,
apellido VARCHAR2(20) default ‘DATOS’,
salary NUMBER(8,2) constraint nn_slary not null,
constraint unk_cons unique (nombre))
tablespace TBS_DAT_PERSONA_01
D, E
Yes, NOT NULL is a column level constraint to ensure that any value in that column is not null. Hence, it can not be used as a table level constraint. However, one can use it on multiple columns.
Similarly, it can be applied on table level using the ALTER command such as:
ALTER TABLE employee
MODIFY(employee_id CONSTRAINT emp_id_nn NOT NULL);
Yes, A,E are correct.
D is wrong, you can declare NOT NULL constraint only in column level.
A,E
D is wrong cause NOT NULL is defined to column level not table level
The letter D is repeated and there is not letter F. ¿?
A primary key constraint combines a NOT NULL constraint and a unique constraint in a single declaration.