Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

SQLPLUS 6. Which SELECT statement would display the next value of the PARTS_ID s

ID: 3916439 • Letter: S

Question

SQLPLUS

6. Which SELECT statement would display the next value of the PARTS_ID sequence?  

a. SELECT NEXTVAL(parts_id)  

FROM SYS.DUAL;  

b. SELECT parts_id.NEXTVAL  

FROM inventory;  

c. SELECT parts_id.NEXTVAL  

FROM SYS.DUAL  

d. SELECT NEXTVAL(parts_id)  

FROM inventory;  

7. What does the COMMENT ON TABLE command do?  

a. assigns a table alias  

b. adds a comment column to a table  

c. adds a comment about a table to the data dictionary  

d. adds a comment about a column to the data dictionary  

8. Which command allows you to alter a view without re?granting object privileges previously granted

on it?  

a. ALTER  

b. CREATE  

c. MODIFY  

d. CREATE OR REPLACE  

9. Given the following Table

EMPLOYEE     DATA TYPE              Key         NULL

?????????????????????????????? ?????????????????????? ?????????? ???????????

EMPLOYEE_ID   NUMBER(6)     PK      N  

NAME   VARCHAR2(15)  

JOB   VARCHAR2(9)  

MANAGER   NUMBER(4)  

DATE_HIRED   DATE              N  

SALARY   NUMBER(7,2)  

BONUS    NUMBER(7,2)  

DEPARTMENT_ID   NUMBER(2)                             N

Which statement would you use to increase the NAME column length to 25?  

a. ALTER TABLE employee  

MODIFY name VARCHAR2(25);  

b. ALTER TABLE employee  

RENAME name VARCHAR2(25);  

c. ALTER employee TABLE  

MODIFY COLUMN name VARCHAR2(25);  

d. ALTER employee TABLE  

MODIFY COLUMN (name VARCHAR2(25));  

10. Evaluate this view definition: CREATE  

OR REPLACE parts_view AS  

SELECT manufacturer_id, COUNT(part_id) TOTAL_PARTS  

FROM parts  

GROUP BY manufacturer_id;  

Which statement can be issued on the PARTS_VIEW view?  

a. SELECT * FROM parts_view;  

b. UPDATE parts_view  

SET total_parts = 10000  

WHERE manufacturer_id = 3983;  

c. DELETE FROM parts_view  

WHERE manufacturer_id=340394  

d. INSERT INTO parts_view  

VALUES (89485, 1009);

Explanation / Answer

6.

SELECT statement would display the next value of the PARTS_ID sequence

SELECT parts_id.NEXTVAL  

FROM SYS.DUAL  

Option c

7.

COMMENT ON TABLE command do adds a comment about a table to the data dictionary  

Option c

8.

CREATE OR REPLACE command allows you to alter a view without re-granting object privileges previously granted on it.

Option d

9.

Statement increase

ALTER TABLE employee  

MODIFY name VARCHAR2(25);  

Option a correct

10.

Statement can be issued on the PARTS_VIEW view:

SELECT * FROM parts_view;  

Option a correct