You need to modify the STUDENTS table to add a primary key o

题目
单选题
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?()
A

ALTER TABLE students ADD PRIMARY KEY student_id;

B

ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);

C

ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;

D

ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);

E

ALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);

参考答案和解析
正确答案: E
解析: 暂无解析
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

单选题
EMPLOYEES and DEPARTMENTS data: EMPLOYEES DEMP_NAME DEPT_ID MGR_ID JOB_ID SALARY EMPLOYEE_I 101 Smith 20 120 SA_REP 4000 102 Martin 10 105 CLERK 2500 103 Chris 20 120 IT_ADMIN 4200 104 John 30 108 HR_CLERK 2500 105 Diana 30 108 IT_ADMIN 5000 106 Smith 40 110 AD_ASST 3000 108 Jennifer 30 110 HR_DIR 6500 110 Bob 40 EX_DIR 8000 120 Ravi 20 110 SA_DIR 6500 DEPARTMENTS DEPARTMENT_ID DEPARTMENT_NAME 10 Admin 20 Education 30 IT 40 Human Resources On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID managers and refers to the EMPLOYEE_ID. On the DEPARTMENTS table DEPARTMENT_ID is the primary key. Evaluate this UPDATE statement. UPDATE employees SET mgr_id = (SELECT mgr_id FROM employees WHERE dept_id= (SELECT department_id FROM departments WHERE department_name = 'Administration')), Salary = (SELECT salary FROM employees WHERE emp_name = 'Smith') WHERE job_id = 'IT_ADMIN'; What happens when the statement is executed?()
A

The statement executes successfully, leaves the manager ID as the existing value, and changes the salary to 4000 for the employees with ID 103 and 105.

B

The statement executes successfully, changes the manager ID to NULL, and changes the salary to 4000 for the employees with ID 103 and 105.

C

The statement executes successfully, changes the manager ID to NULL, and changes the salary to 3000 for the employees with ID 103 and 105.

D

The statement fails because there is more than one row matching the employee name Smith.

E

The statement fails because there is more than one row matching the IT_ADMIN job ID in the EMPLOYEES table.

F

The statement fails because there is no 'Administration' department in the DEPARTMENTS table.


正确答案: C
解析: 暂无解析

第2题:

单选题
Which constraint can be defined only at the column level?()
A

UNIQUE

B

NOT NULL

C

CHECK

D

PRIMARY KEY

E

FOREIGN KEY


正确答案: E
解析: 暂无解析

第3题:

单选题
Which syntax turns an existing constraint on?()
A

ALTER TABLE table_name ENABLE constraint_name;

B

ALTER TABLE table_name STATUS = ENABLE CONSTRAINT constraint _ name;

C

ALTER TABLE table_name ENABLE CONSTRAINT constraint _ name;

D

ALTER TABLE table_name TURN ON CONSTRAINT constraint _ name;


正确答案: C
解析: 暂无解析

第4题:

单选题
You need to give the MANAGER role the ability to select from, insert into, and modify existing rows in the STUDENT_GRADES table. Anyone given this MANAGER role should be able to pass those privileges on to others.Which statement accomplishes this?()
A

GRANT select, insert, update ON student_grades TO manager

B

GRANT select, insert, update ON student_grades TO ROLE manager

C

GRANT select, insert, modify ON student_grades TO manager WITH GRANT OPTION;

D

GRANT select, insert, update ON student_grades TO manager WITH GRANT OPTION;

E

GRANT select, insert, update ON student_grades TO ROLE manager WITH GRANT OPTION;

F

GRANT select, insert, modify ON student_grades TO ROLE manager WITH GRANT OPTION;


正确答案: F
解析: 暂无解析

第5题:

单选题
The DBA issues this SQL command: CREATE USER scott IDENTIFIES by tiger; What privileges does the user Scott have at this point?()
A

No privileges.

B

Only the SELECT privilege.

C

Only the CONNECT privilege.

D

All the privileges of a default user.


正确答案: A
解析: 暂无解析

第6题:

单选题
The EMPLOYEES table contains these columns: LAST_NAME VARCHAR2 (25) SALARY NUMBER (6,2) COMMISSION_PCT NUMBER (6) You need to write a query that will produce these results: 1.Display the salary multiplied by the commission_pct. 2.Exclude employees with a zero commission_pct. 3.Display a zero for employees with a null commission value. Evaluate the SQL statement: SELECT LAST_NAME, SALARY*COMMISSION_PCT FROM EMPLOYEES WHERE COMMISSION_PCT IS NOT NULL; What does the statement provide?()
A

all of the desired results

B

two of the desired results

C

one of the desired results

D

an error statement


正确答案: A
解析: 暂无解析

第7题:

单选题
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?()
A

ALTER TABLE students ADD PRIMARY KEY _ id;

B

ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);

C

ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;

D

ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);

E

ALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);


正确答案: D
解析: 暂无解析

第8题:

多选题
Which are DML statements?()
A

COMMIT

B

MERGE

C

UPDATE

D

DELETE

E

CREATE

F

DROP...


正确答案: C,A
解析: 暂无解析

第9题:

多选题
Evaluate this SQL statement: SELECT e.emp_name, d.dept_name FROM employees e JOIN departments d USING (department_id) WHERE d.department_id NOT IN (10,40) ORSER BY dept_name; The statement fails when executed. Which change fixes the error?()
A

remove the ORDER BY clause

B

remove the table alias prefix from the WHERE clause

C

remove the table alias from the SELECT clause

D

prefix the column in the USING clause with the table alias

E

prefix the column in the ORDER BY clause with the table alias

F

replace the condition d.department_id NOT IN (10,40) in the WHERE clause with d.department_id <> 10 AND d.department_id <> 40


正确答案: F,A
解析: 暂无解析

第10题:

单选题
You need to change the definition of an existing table. The COMMERCIALS table needs its DESCRIPTION column changed to hold varying length characters up to 2000 bytes. The column can currently hold 1000 bytes per value. The table contains 20000 rows. Which statement is valid?()
A

ALTER TABLE commercials MODIFY (description CHAR2(2000));

B

ALTER TABLE commercials CHANGE (description CHAR2(2000));

C

ALTER TABLE commercials CHANGE (description VARCHAR2 (2000));

D

ALTER TABLE commercials MODIFY (description VARCHAR2 (2000));

E

You cannot increase the size of a column if the table has rows.


正确答案: B
解析: 暂无解析

更多相关问题