As a developer, you inherit this table as part of a project:
CREATE TABLE exam (
Exam_id INTEGER UNSIGNED NOT NULL PRIMARY KEY,
Examinee_id INTEGER UNSIGNED UNIQUE,
Score INTEGER UNSIGNED
)
What change should you make to ensure that examinee_id is an integer value throughout
the table?
A.
The examinee_id column should be designated as PRIMARY KEY.
B.
A NOT NULL qualifier should be moved from exam-id to examinee-id.
C.
The PRIMARY KEY should be dropped and re-created as PRIMARY KEY (examinee-id,
exam_id).
D.
A NOT NULL qualifier should be added to examinee_id.
A is not correct because there is already a primary key in the table. I would choose D.
I think D also.
THE GOAL:
to ensure that examinee_id is an integer value throughout the table
A, the Key definitely should not be on examinee_id since it can still be null. A key should never be on something that can be null.
B, Exam_ID should have a unique primary key thats NOT NULL to distinguish itself out of other exams. You accomplish the statement that it asks for but it ruins the entire table out of it.
C, examinee_id still can be null which does not make it an integer if null, you still don’t accomplish the statement.
D, Not null on examinee_id seems good. Since the attribute is INT, it has to have an number which makes the statement valid.
D too
I would choose b because primary key can not be NULL anyway.
D