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
Explanation:
A is the correct response.
The not null constraint can be defined only per column
A is no correct, cause PRIMARY KEY(A,B) will request data be unique on the combine of A and B.
Like data blow will OK on PRIMARY KEY(A,B):
row1:benz, 100
row2:benz, 200
For UNIQUE (A,B), it will request data be unique on each column.
Like data blow will NG on UNIQUE (A,B):
row1:benz, 100
row2:benz, 200
Really,
and option ( E ) is other correct response.
last option also
So, the correct answers are first and last option.
yes
I’ve got a question.
Yes First and last seems to be the more accurate, but form what I see and tested the UNIQUE Constraint will work only if the 2 columns together are the same not for separate, meaning that is impossible to insert a row containing for instance. (If it already exists)
employee_id = 1234
login_id = 4567
But you can easily just insert a row containing
employee_id = 1234
login_id = 8901
Wouldn’t that make every statement wrong?
Is this just a tricky question? Can anyone that actually certified this confirm if that’s the expected answer? The question doesn’t explicit states compose constrains.
You are right Memi. Here unique means the values of two columns will be unique together.
employee_id = 101
login_id = 101
acceptable. Then 101, 102 is ok. after that 102, 101 is OK too. But 101, 101 is not allowed again also 101, 102 and 102, 101 no allowed. It is unique by two columns.
So the correct answer is A, F (in fact last number will be F). Second and third lasts are not correct because NOT NULL is a inline command. ‘You must define NOT NULL and NULL using inline specification’.
This question came in the exam I am answer a but found it wrong answer š
Hi Suheil, when did you do the exam? Is it enough to study these 75 questions for the exam?
Sayed, I just passed it. Except 5-6 questions, all else I remembered from this one and 1z0-051 dumps.
There is no option F displayed, but option D two times. So we do not know, what option F is.
OK, let’s assume, the first D would be D, the second D would be E, and E would be F… š
Then, option A and F would be the right answers.
B isn’t correct (login_id is missing NOT NULL)
C isn’t correct (employee_id and login_id are missing NOT NULL)
D and E are (obviously) equal and not correct (NOT NULL is an inline constraint and not to be used as shown here)
Yup, A and F look like correct answers.
e is wrong.
unique allows null but you can’t insert multi null into the same column.
AD is correct.
Hi Guys,
Iām doing preparation for Oracle Database 12c: sql fundamentals, so i have need some dump copies for it. if you guys have any idea about Oracle Databse 12c: sql fundamentals then please send me at [email protected] ..
Thanks,
Amit
Hi I am about to write that exam also. Can I please have the dumps also.
Options are 4th&5th
E is the coorect answer, the F answer is not given.
D is false besause we can’t use CONSTRAINT emp_id_nn NOT NULL (emp_id)
Downlaod new Madden 17 Coin Glitch and Generator game!
Best Madden NFL 17 Coin Glitch and Generator for uunlimied Cash and
Coins!
DOWNLOAD LINK : Madden NFL 17 Coin Glich and Generator
TESTE1 —-
CREATE TABLE TESTE1 (X NUMBER,
Y NUMBER,
CONSTRAINT test1_id_PK PRIMARY KEY (x,y)); –> Table created.
INSERT INTO TESTE1
VALUES (1,1); ——-> 1 ROW CREATED
INSERT INTO TESTE1
VALUES (1,2); ——-> 1 ROW CREATED
INSERT INTO TESTE1
VALUES (2,1); ——-> 1 ROW CREATED
INSERT INTO TESTE1
VALUES (2,2); ——-> 1 ROW CREATED
INSERT INTO TESTE1
VALUES (1,2); ORA-00001: unique constraint (TESTES.TEST1_ID_PK) violated
INSERT INTO TESTE1
VALUES (1,3);
TESTE2 —-
CREATE TABLE TESTE2 (X NUMBER CONSTRAINT test2x_id_nn NOT NULL,
Y NUMBER CONSTRAINT test2y_id_nn NOT NULL,
CONSTRAINT test2_uk UNIQUE (x,y)); –> Table created.
INSERT INTO TESTE2
VALUES (1,1); ——-> 1 ROW CREATED
INSERT INTO TESTE2
VALUES (1,2); ——-> 1 ROW CREATED
INSERT INTO TESTE2
VALUES (2,1); ——-> 1 ROW CREATED
INSERT INTO TESTE2
VALUES (2,2); ——-> 1 ROW CREATED
INSERT INTO TESTE2
VALUES (1,2); ORA-00001: unique constraint (TESTES.TEST2_UK) violated
INSERT INTO TESTE2
VALUES (1,3); ——-> 1 ROW CREATED
INSERT INTO TESTE2
VALUES (1,NULL); ORA-01400: cannot insert NULL into (“TESTES”.”TESTE2″.”Y”)
TESTE3 —-
CREATE TABLE TESTE3 (X NUMBER,
Y NUMBER,
CONSTRAINT teste3_nn NOT NULL(x,y), <—- DEVE SER DEFINIDO PARA CADA COLUNA
CONSTRAINT teste3_uk UNIQUE (x,y));
CONSTRAINT teste3_nn NOT NULL(x,y),
ERROR at line 3:
ORA-00904: : invalid identifier