nerdexam
Oracle

1Z0-007 · Question #186

You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty. Which statement accomplishes this task?

The correct answer is D. ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id). ALTER TABLE table_name ADD [CONSTRAINT constraint] type (coloumn); Incorrect answer: E no such MODIFY keyword

Creating and Managing Schema Objects

Question

You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty. Which statement accomplishes this task?

Options

  • AALTER TABLE students ADD PRIMARY KEY student_id;
  • BALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);
  • CALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;
  • DALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);
  • EALTER TABLE studentsMODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);

How the community answered

(21 responses)
  • A
    10% (2)
  • B
    14% (3)
  • D
    71% (15)
  • E
    5% (1)

Explanation

ALTER TABLE table_name ADD [CONSTRAINT constraint] type (coloumn); Incorrect answer: E no such MODIFY keyword

Topics

#ALTER TABLE#PRIMARY KEY constraint#constraint syntax#DDL

Community Discussion

No community discussion yet for this question.

Full 1Z0-007 Practice