Which two SQL statements would create the required table?

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?

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



Leave a Reply 9

Your email address will not be published. Required fields are marked *


wuxun

wuxun

D is wrong.
Not null can only define on column level not table level.

venus

venus

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.

humberto

humberto

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

9jansen

9jansen

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);

luca

luca

Yes, A,E are correct.
D is wrong, you can declare NOT NULL constraint only in column level.

Corne

Corne

A,E

D is wrong cause NOT NULL is defined to column level not table level

Jenny

Jenny

The letter D is repeated and there is not letter F. ¿?

The Tuk

The Tuk

A primary key constraint combines a NOT NULL constraint and a unique constraint in a single declaration.